Skip to content

Commit

Permalink
dealing with 'sub'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimosts committed Sep 24, 2023
1 parent 4f72f47 commit 9c49237
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpmpy/transformations/linearize.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def canonical_comparison(lst_of_expr):
if isinstance(rhs, _NumVarImpl):
lhs2, rhs = [-1 * rhs], 0
elif isinstance(rhs, Operator) and rhs.name == "sum":
lhs2, rhs = [-1 * b if isinstance(b, _NumVarImpl) else 1 * b for b in rhs.args
lhs2, rhs = [-1 * b if isinstance(b, _NumVarImpl) else 1 * b.args[0] for b in rhs.args
if isinstance(b, _NumVarImpl) or isinstance(b, Operator)], \
sum(b for b in rhs.args if is_num(b))
elif isinstance(rhs, Operator) and rhs.name == "wsum":
Expand Down

0 comments on commit 9c49237

Please sign in to comment.