From b20171b6ea182474cef10758f3c2e333742fd1b3 Mon Sep 17 00:00:00 2001 From: Floris-Jan Willemsen Date: Tue, 22 Jul 2025 23:38:30 +0200 Subject: [PATCH 01/16] 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 02/16] 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 03/16] 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 04/16] 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 05/16] 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 06/16] 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 07/16] 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 08/16] 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 09/16] 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 10/16] 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 11/16] 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 12/16] 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 13/16] 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 14/16] 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 15/16] 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 16/16] 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