Skip to content

Commit

Permalink
ensure int bounds in var creation(#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wout4 authored Mar 1, 2024
1 parent 54d9681 commit f038263
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpmpy/transformations/flatten_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def get_or_make_var(expr):
(flatexpr, flatcons) = normalized_numexpr(expr)

lb, ub = flatexpr.get_bounds()
ivar = _IntVarImpl(lb, ub)
ivar = _IntVarImpl(math.floor(lb), math.ceil(ub))
return (ivar, [flatexpr == ivar]+flatcons)

def get_or_make_var_or_list(expr):
Expand Down

0 comments on commit f038263

Please sign in to comment.