From 82824ad7b2471e6b5b56c022e74bbf92ac4b9825 Mon Sep 17 00:00:00 2001 From: wout4 Date: Thu, 29 Feb 2024 15:42:34 +0100 Subject: [PATCH] use floor and ceil to ensure int bounds --- cpmpy/transformations/flatten_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpmpy/transformations/flatten_model.py b/cpmpy/transformations/flatten_model.py index bb9d0a82e..2774e188e 100644 --- a/cpmpy/transformations/flatten_model.py +++ b/cpmpy/transformations/flatten_model.py @@ -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):