@@ -438,6 +438,7 @@ namespace lp {
438
438
439
439
indexed_uint_set m_changed_rows;
440
440
indexed_uint_set m_changed_columns;
441
+ indexed_uint_set m_changed_terms; // a term is defined by its column j, as in lar_solver.get_term(j)
441
442
// m_column_to_terms[j] is the set of all k such lra.get_term(k) depends on j
442
443
std::unordered_map<unsigned , std::unordered_set<unsigned >> m_columns_to_terms;
443
444
@@ -886,12 +887,12 @@ namespace lp {
886
887
SASSERT (entry_invariant (ei));
887
888
}
888
889
889
- void find_changed_terms_and_more_changed_rows (std::unordered_set< unsigned > & changed_terms ) {
890
+ void find_changed_terms_and_more_changed_rows () {
890
891
for (unsigned j : m_changed_columns) {
891
892
const auto it = m_columns_to_terms.find (j);
892
893
if (it != m_columns_to_terms.end ())
893
894
for (unsigned k : it->second ) {
894
- changed_terms .insert (k);
895
+ m_changed_terms .insert (k);
895
896
}
896
897
if (!m_var_register.external_is_used (j))
897
898
continue ;
@@ -923,9 +924,8 @@ namespace lp {
923
924
delete_column (j);
924
925
}
925
926
}
926
- std::unordered_set<unsigned > changed_terms; // a term is signified by the term column, like j in lra.get_term(j)
927
- find_changed_terms_and_more_changed_rows (changed_terms);
928
- for (unsigned j : changed_terms) {
927
+ find_changed_terms_and_more_changed_rows ();
928
+ for (unsigned j : m_changed_terms) {
929
929
for (const auto & cs: m_l_matrix.column (j)) {
930
930
m_changed_rows.insert (cs.var ());
931
931
}
@@ -1324,16 +1324,24 @@ namespace lp {
1324
1324
}
1325
1325
1326
1326
lia_move tighten_terms_with_S () {
1327
- for (unsigned j = 0 ; j < lra.column_count (); j++) {
1327
+ std_vector<unsigned > cleanup;
1328
+ lia_move ret = lia_move::undef;
1329
+ for (unsigned j : m_changed_terms) {
1330
+ cleanup.push_back (j);
1328
1331
if (!lra.column_has_term (j) || lra.column_is_free (j) ||
1329
- is_fixed (j) || !lia.column_is_int (j))
1332
+ is_fixed (j) || !lia.column_is_int (j)) {
1330
1333
continue ;
1334
+ }
1331
1335
1332
- if (tighten_bounds_for_term_column (j))
1333
- return lia_move::conflict;
1336
+ if (tighten_bounds_for_term_column (j)) {
1337
+ ret = lia_move::conflict;
1338
+ break ;
1339
+ }
1334
1340
}
1335
-
1336
- return lia_move::undef;
1341
+ for (unsigned j: cleanup) {
1342
+ m_changed_terms.remove (j);
1343
+ }
1344
+ return ret;
1337
1345
}
1338
1346
1339
1347
std::ostream& print_queue (std::queue<unsigned > q, std::ostream& out) {
0 commit comments