Skip to content

Commit

Permalink
remove unused case for linearize
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimosts committed Sep 13, 2023
1 parent 0b6d7c5 commit be40ece
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cpmpy/transformations/linearize.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ def linearize_constraint(lst_of_expr, supported={"sum","wsum"}, reified=False):
new_args.append(arg)
lhs = Operator("wsum",[new_weights, new_args])

if isinstance(lhs, Operator) and lhs.name == "mul" and len(lhs.args) == 2 and is_num(lhs.args[0]):
# convert to wsum
lhs = Operator("wsum",[[lhs.args[0]],[lhs.args[1]]])

# now fix the comparisons themselves
if cpm_expr.name == "<":
new_rhs, cons = get_or_make_var(rhs - 1) # if rhs is constant, will return new constant
Expand Down

0 comments on commit be40ece

Please sign in to comment.