mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
rebase with upstream
Signed-off-by: Lev <levnach@hotmail.com>
This commit is contained in:
parent
11d37d97a1
commit
c09c944922
5 changed files with 36 additions and 22 deletions
|
@ -68,9 +68,9 @@ class gomory::imp {
|
|||
m_k.addmul(new_a, upper_bound(j).x);
|
||||
m_ex.push_justification(column_upper_bound_constraint(j));
|
||||
}
|
||||
m_t.add_monomial(new_a, j);
|
||||
m_lcm_den = lcm(m_lcm_den, denominator(new_a));
|
||||
TRACE("gomory_cut_detail", tout << "v" << j << " new_a = " << new_a << ", k = " << m_k << ", m_lcm_den = " << m_lcm_den << "\n";);
|
||||
m_t.add_coeff_var(new_a, j);
|
||||
lcm_den = lcm(lcm_den, denominator(new_a));
|
||||
TRACE("gomory_cut_detail", tout << "new_a = " << new_a << ", k = " << m_k << ", lcm_den = " << lcm_den << "\n";);
|
||||
}
|
||||
|
||||
void real_case_in_gomory_cut(const mpq & a, unsigned j) {
|
||||
|
@ -98,8 +98,8 @@ class gomory::imp {
|
|||
m_k.addmul(new_a, upper_bound(j).x); // k += upper_bound(j).x * new_a;
|
||||
m_ex.push_justification(column_upper_bound_constraint(j));
|
||||
}
|
||||
TRACE("gomory_cut_detail_real", tout << a << "*v" << j << " k: " << m_k << "\n";);
|
||||
m_t.add_monomial(new_a, j);
|
||||
TRACE("gomory_cut_detail_real", tout << a << "*v" << x_j << " k: " << m_k << "\n";);
|
||||
m_t.add_coeff_var(new_a, x_j);
|
||||
}
|
||||
|
||||
lia_move report_conflict_from_gomory_cut() {
|
||||
|
@ -124,12 +124,12 @@ class gomory::imp {
|
|||
if (!m_k.is_int())
|
||||
m_k = ceil(m_k);
|
||||
// switch size
|
||||
m_t.add_monomial(- mpq(1), v);
|
||||
m_t.add_coeff_var(- mpq(1), v);
|
||||
m_k.neg();
|
||||
} else {
|
||||
if (!m_k.is_int())
|
||||
m_k = floor(m_k);
|
||||
m_t.add_monomial(mpq(1), v);
|
||||
m_t.add_coeff_var(mpq(1), v);
|
||||
}
|
||||
} else {
|
||||
m_lcm_den = lcm(m_lcm_den, denominator(m_k));
|
||||
|
@ -144,10 +144,8 @@ class gomory::imp {
|
|||
m_k *= m_lcm_den;
|
||||
}
|
||||
// negate everything to return -pol <= -m_k
|
||||
for (const auto & pi: pol) {
|
||||
TRACE("gomory_cut", tout << pi.first << "* " << "v" << pi.second << "\n";);
|
||||
m_t.add_monomial(-pi.first, pi.second);
|
||||
}
|
||||
for (const auto & pi: pol)
|
||||
m_t.add_coeff_var(-pi.first, pi.second);
|
||||
m_k.neg();
|
||||
}
|
||||
TRACE("gomory_cut_detail", tout << "k = " << m_k << std::endl;);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue