mirror of
https://github.com/Z3Prover/z3
synced 2025-10-09 01:11:55 +00:00
separate the gomory cut functionality in a separate file
Signed-off-by: Lev <levnach@hotmail.com>
This commit is contained in:
parent
26764b076f
commit
324396e403
7 changed files with 284 additions and 232 deletions
|
@ -535,7 +535,7 @@ public:
|
|||
return m_columns_to_ul_pairs()[j].lower_bound_witness();
|
||||
}
|
||||
|
||||
void subs_term_columns(lar_term& t) {
|
||||
void subs_term_columns(lar_term& t, mpq & rs) {
|
||||
vector<std::pair<unsigned,unsigned>> columns_to_subs;
|
||||
for (const auto & m : t.m_coeffs) {
|
||||
unsigned tj = adjust_column_index_to_term_index(m.first);
|
||||
|
@ -545,9 +545,12 @@ public:
|
|||
for (const auto & p : columns_to_subs) {
|
||||
auto it = t.m_coeffs.find(p.first);
|
||||
lp_assert(it != t.m_coeffs.end());
|
||||
const lar_term& lt = get_term(p.second);
|
||||
mpq v = it->second;
|
||||
t.m_coeffs.erase(it);
|
||||
t.m_coeffs[p.second] = v;
|
||||
if (lt.m_v.is_zero()) continue;
|
||||
rs -= v * lt.m_v;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue