3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-19 19:02:02 +00:00

roll back in find_beneficial_column_in_row_tableau_rows

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-04-11 12:24:22 -07:00
parent 38c73090d8
commit 087354995d

View file

@ -280,8 +280,8 @@ public:
// a short row produces short infeasibility explanation and benefits at least one pivot operation // a short row produces short infeasibility explanation and benefits at least one pivot operation
int choice = -1; int choice = -1;
int nchoices = 0; int nchoices = 0;
unsigned prev_damage = UINT_MAX; unsigned num_of_non_free_basics = 1000000;
unsigned len = UINT_MAX; unsigned len = 100000000;
unsigned bj = this->m_basis[i]; unsigned bj = this->m_basis[i];
bool bj_needs_to_grow = needs_to_grow(bj); bool bj_needs_to_grow = needs_to_grow(bj);
for (unsigned k = 0; k < this->m_A.m_rows[i].size(); k++) { for (unsigned k = 0; k < this->m_A.m_rows[i].size(); k++) {
@ -296,18 +296,14 @@ public:
if (!monoid_can_increase(rc)) if (!monoid_can_increase(rc))
continue; continue;
} }
unsigned damage = numeric_traits<T>::is_big(rc.coeff())? prev_damage: unsigned damage = get_number_of_basic_vars_that_might_become_inf(j);
get_number_of_basic_vars_that_might_become_inf(j); if (damage < num_of_non_free_basics) {
if (damage < prev_damage) { num_of_non_free_basics = damage;
prev_damage = damage;
len = this->m_A.m_columns[j].size(); len = this->m_A.m_columns[j].size();
choice = k; choice = k;
nchoices = 1; nchoices = 1;
} else if (damage == prev_damage } else if (damage == num_of_non_free_basics &&
&& this->m_A.m_columns[j].size() <= len && (this->m_settings.random_next() % (++nchoices))) {
this->m_A.m_columns[j].size() <= len
&&
(this->m_settings.random_next() % (++nchoices))) {
choice = k; choice = k;
len = this->m_A.m_columns[j].size(); len = this->m_A.m_columns[j].size();
} }