Skip to content

Commit

Permalink
fix maximum decomposition
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 committed Jun 4, 2024
1 parent 2742548 commit 160cb89
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cpmpy/expressions/globalfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ def decompose_comparison(self, cpm_op, cpm_rhs):
"""
from .python_builtins import any, all
if cpm_op == "==": # can avoid creating aux var here
return [any(x == cpm_rhs for x in self.args),
all(x <= cpm_rhs for x in self.args)], []
return [any(x >= cpm_rhs for x in self.args)], [all(x <= cpm_rhs for x in self.args)]

lb, ub = self.get_bounds()
_max = intvar(lb, ub)
Expand Down

0 comments on commit 160cb89

Please sign in to comment.