3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 12:28:44 +00:00

fixes in gomory cut

Signed-off-by: Lev <levnach@hotmail.com>
This commit is contained in:
Lev 2018-09-15 17:33:35 -07:00
parent 03d55426bb
commit 8c122ba9bd
2 changed files with 8 additions and 17 deletions

View file

@ -1704,11 +1704,10 @@ public:
TRACE("arith", tout << "canceled\n";);
return l_undef;
}
/*
if (!check_idiv_bounds()) {
TRACE("arith", tout << "idiv bounds check\n";);
return l_false;
}*/
}
lp::lar_term term;
lp::mpq k;
lp::explanation ex; // TBD, this should be streamlined accross different explanations

View file

@ -55,26 +55,18 @@ class gomory::imp {
mpq new_a;
mpq one_minus_fj = 1 - fj;
if (at_lower(j)) {
bool go_for_pos_a = fj / one_minus_f0 < one_minus_fj / f0;
if (go_for_pos_a) {
new_a = fj / one_minus_f0;
}
else {
new_a = one_minus_fj / f0;
}
mpq fj_over_one_min_f0 = fj / one_minus_f0;
mpq one_minus_fj_over_f0 = one_minus_fj / f0;
new_a = fj_over_one_min_f0 < one_minus_fj_over_f0? fj_over_one_min_f0 : one_minus_fj_over_f0;
m_k.addmul(new_a, lower_bound(j).x);
m_ex.push_justification(column_lower_bound_constraint(j), new_a);
}
else {
bool go_for_pos_a = fj / f0 < one_minus_fj / one_minus_f0;
mpq fj_over_f0 = fj / f0;
mpq one_minus_fj_over_one_minus_f0 = one_minus_fj / one_minus_f0;
lp_assert(at_upper(j));
// the upper terms are inverted
if (go_for_pos_a) {
new_a = - fj / f0;
}
else {
new_a = - one_minus_fj / one_minus_f0;
}
// the upper terms are inverted - therefore we have -
new_a = - (fj_over_f0 < one_minus_fj_over_one_minus_f0? fj_over_f0 : one_minus_fj_over_one_minus_f0);
m_k.addmul(new_a, upper_bound(j).x);
m_ex.push_justification(column_upper_bound_constraint(j), new_a);
}