From bbfdfff8b97ca4b9fa464626e20b30bb386afa24 Mon Sep 17 00:00:00 2001 From: cprudhom Date: Fri, 6 Sep 2024 11:04:04 +0200 Subject: [PATCH] Fix treatment of IntAffineView in IntLinCombFactory --- .../solver/constraints/nary/sum/IntLinCombFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solver/src/main/java/org/chocosolver/solver/constraints/nary/sum/IntLinCombFactory.java b/solver/src/main/java/org/chocosolver/solver/constraints/nary/sum/IntLinCombFactory.java index 297de9627..c8c3dd25e 100644 --- a/solver/src/main/java/org/chocosolver/solver/constraints/nary/sum/IntLinCombFactory.java +++ b/solver/src/main/java/org/chocosolver/solver/constraints/nary/sum/IntLinCombFactory.java @@ -121,7 +121,7 @@ public static Constraint reduce(IntVar[] VARS, int[] COEFFS, Operator OPERATOR, long b = view.b; NVARS[i] = var; NCOEFFS[i] *= a; - RESULT += b * NCOEFFS[i]; + RESULT -= b * NCOEFFS[i]; } int id = NVARS[i].getId(); int pos = map.get(id);