Skip to content

Commit

Permalink
sort intermediate bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 committed Jul 10, 2023
1 parent f217843 commit 7dab664
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cpmpy/expressions/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,9 @@ def get_bounds(self):
weights, vars = self.args
bounds = []
for i, varbounds in enumerate([get_bounds(arg) for arg in vars]):
bounds += [(list(weights[i] * x for x in varbounds))]
sortbounds = (list(weights[i] * x for x in varbounds))
sortbounds.sort()
bounds += [sortbounds]
lbs, ubs = (zip(*bounds))
lowerbound, upperbound = sum(lbs), sum(ubs)
elif self.name == 'sub':
Expand Down

0 comments on commit 7dab664

Please sign in to comment.