From 2ca1187b3ad5308c824d37dab5dfe310eacc1029 Mon Sep 17 00:00:00 2001 From: Lev Nachmanson Date: Wed, 10 Jan 2024 10:50:56 -1000 Subject: [PATCH] fix a bug in polarity Signed-off-by: Lev Nachmanson --- src/math/lp/gomory.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/math/lp/gomory.cpp b/src/math/lp/gomory.cpp index ba0e69558..cefd9767f 100644 --- a/src/math/lp/gomory.cpp +++ b/src/math/lp/gomory.cpp @@ -276,10 +276,12 @@ public: } if (is_real(j)) real_case_in_gomory_cut(- p.coeff(), j); - else if (!p.coeff().is_int()) { - m_fj = fractional_part(-p.coeff()); - m_one_minus_fj = 1 - m_fj; - int_case_in_gomory_cut(j); + else { + if (!p.coeff().is_int()) { + m_fj = fractional_part(-p.coeff()); + m_one_minus_fj = 1 - m_fj; + int_case_in_gomory_cut(j); + } if (p.coeff().is_pos()) { if (at_lower(j)) set_polarity(1);