Skip to content

Commit 2ca1187

Browse files
committed
fix a bug in polarity
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
1 parent 75005d9 commit 2ca1187

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/math/lp/gomory.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,12 @@ struct create_cut {
276276
}
277277
if (is_real(j))
278278
real_case_in_gomory_cut(- p.coeff(), j);
279-
else if (!p.coeff().is_int()) {
280-
m_fj = fractional_part(-p.coeff());
281-
m_one_minus_fj = 1 - m_fj;
282-
int_case_in_gomory_cut(j);
279+
else {
280+
if (!p.coeff().is_int()) {
281+
m_fj = fractional_part(-p.coeff());
282+
m_one_minus_fj = 1 - m_fj;
283+
int_case_in_gomory_cut(j);
284+
}
283285
if (p.coeff().is_pos()) {
284286
if (at_lower(j))
285287
set_polarity(1);

0 commit comments

Comments
 (0)