mirror of
https://github.com/Z3Prover/z3
synced 2025-04-15 13:28:47 +00:00
keep the coefficients of 'at lower' variables positive, and the rest negative for Gomory cuts
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
parent
ac878698b9
commit
a99ebed907
|
@ -55,14 +55,14 @@ class gomory::imp {
|
||||||
mpq new_a;
|
mpq new_a;
|
||||||
mpq one_minus_fj = 1 - fj;
|
mpq one_minus_fj = 1 - fj;
|
||||||
if (at_lower(j)) {
|
if (at_lower(j)) {
|
||||||
new_a = fj < one_minus_f0? fj / one_minus_f0 : (- one_minus_fj / f0);
|
new_a = fj < one_minus_f0? fj / one_minus_f0 : one_minus_fj / f0;
|
||||||
m_k.addmul(new_a, lower_bound(j).x);
|
m_k.addmul(new_a, lower_bound(j).x);
|
||||||
m_ex.push_justification(column_lower_bound_constraint(j), new_a);
|
m_ex.push_justification(column_lower_bound_constraint(j), new_a);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
lp_assert(at_upper(j));
|
lp_assert(at_upper(j));
|
||||||
// the upper terms are inverted: therefore we have the minus
|
// the upper terms are inverted: therefore we have the minus
|
||||||
new_a = fj < f0? (- fj / f0 ) : (one_minus_fj / one_minus_f0);
|
new_a = - (fj < f0? fj / f0 : one_minus_fj / one_minus_f0);
|
||||||
m_k.addmul(new_a, upper_bound(j).x);
|
m_k.addmul(new_a, upper_bound(j).x);
|
||||||
m_ex.push_justification(column_upper_bound_constraint(j), new_a);
|
m_ex.push_justification(column_upper_bound_constraint(j), new_a);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue