Skip to content

Commit dc7185d

Browse files
committed
change the name of m_changed_columns to m_changed_f_columns
Signed-off-by: Lev Nachmanson <[email protected]>
1 parent 32e77d8 commit dc7185d

File tree

1 file changed

+17
-27
lines changed

1 file changed

+17
-27
lines changed

src/math/lp/dioph_eq.cpp

+17-27
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ namespace lp {
504504
std::unordered_map<unsigned, std_vector<unsigned>> m_row2fresh_defs;
505505

506506
indexed_uint_set m_changed_rows;
507-
// m_changed_columns are the columns that just became fixed, or those that just stopped being fixed.
507+
// m_changed_f_columns are the columns that just became fixed, or those that just stopped being fixed.
508508
// If such a column appears in an entry it has to be recalculated.
509-
indexed_uint_set m_changed_columns;
509+
indexed_uint_set m_changed_f_columns;
510510
indexed_uint_set m_changed_terms; // represented by term columns
511511
indexed_uint_set m_terms_to_tighten; // represented by term columns
512512
// m_column_to_terms[j] is the set of all k such lra.get_term(k) depends on j
@@ -776,7 +776,7 @@ namespace lp {
776776

777777
void add_changed_column(unsigned j) {
778778
TRACE("dio", lra.print_column_info(j, tout););
779-
m_changed_columns.insert(j);
779+
m_changed_f_columns.insert(j);
780780
}
781781
std_vector<const lar_term*> m_added_terms;
782782
std::unordered_set<const lar_term*> m_active_terms;
@@ -833,7 +833,7 @@ namespace lp {
833833
if (ignore_big_nums() && lra.get_lower_bound(j).x.is_big())
834834
return;
835835
TRACE("dio", tout << "j:" << j << "\n"; lra.print_column_info(j, tout););
836-
m_changed_columns.insert(j);
836+
m_changed_f_columns.insert(j);
837837
lra.trail().push(undo_fixed_column(*this, j));
838838
}
839839

@@ -1014,7 +1014,7 @@ namespace lp {
10141014
}
10151015

10161016
void find_changed_terms_and_more_changed_rows() {
1017-
for (unsigned j : m_changed_columns) {
1017+
for (unsigned j : m_changed_f_columns) {
10181018
const auto it = m_columns_to_terms.find(j);
10191019
if (it != m_columns_to_terms.end())
10201020
for (unsigned k : it->second) {
@@ -1114,7 +1114,7 @@ namespace lp {
11141114
remove_irrelevant_fresh_defs();
11151115

11161116
eliminate_substituted_in_changed_rows();
1117-
m_changed_columns.reset();
1117+
m_changed_f_columns.reset();
11181118
m_changed_rows.reset();
11191119
m_changed_terms.reset();
11201120
SASSERT(entries_are_ok());
@@ -1630,7 +1630,7 @@ namespace lp {
16301630
auto r = tighten_bounds_for_non_trivial_gcd(g, j, true);
16311631
if (r == lia_move::undef)
16321632
r = tighten_bounds_for_non_trivial_gcd(g, j, false);
1633-
if (r == lia_move::undef && m_changed_columns.contains(j))
1633+
if (r == lia_move::undef && m_changed_f_columns.contains(j))
16341634
r = lia_move::continue_with_check;
16351635
return r;
16361636
}
@@ -1801,30 +1801,23 @@ namespace lp {
18011801
mpq rs;
18021802
bool is_strict = false;
18031803
u_dependency* b_dep = nullptr;
1804-
SASSERT(!g.is_zero());
1804+
SASSERT(!g.is_zero() && !g.is_one());
18051805

18061806
if (lra.has_bound_of_type(j, b_dep, rs, is_strict, is_upper)) {
1807-
TRACE("dio",
1808-
tout << "current " << (is_upper? "upper":"lower") << " bound for x" << j << ":"
1809-
<< rs << std::endl;);
1807+
TRACE("dio", tout << "x" << j << (is_upper? " <= ":" >= ") << rs << std::endl;);
18101808
mpq rs_g = (rs - m_c) % g;
1811-
if (rs_g.is_neg()) {
1809+
if (rs_g.is_neg())
18121810
rs_g += g;
1813-
}
1814-
if (! (!rs_g.is_neg() && rs_g.is_int())) {
1815-
std::cout << "rs:" << rs << "\n";
1816-
std::cout << "m_c:" << m_c << "\n";
1817-
std::cout << "g:" << g << "\n";
1818-
std::cout << "rs_g:" << rs_g << "\n";
1819-
}
1820-
SASSERT(rs_g.is_int());
1811+
1812+
SASSERT(rs_g.is_int() && !rs_g.is_neg());
1813+
18211814
TRACE("dio", tout << "(rs - m_c) % g:" << rs_g << std::endl;);
18221815
if (!rs_g.is_zero()) {
18231816
if (tighten_bound_kind(g, j, rs, rs_g, is_upper))
18241817
return lia_move::conflict;
1825-
} else {
1826-
TRACE("dio", tout << "no improvement in the bound\n";);
18271818
}
1819+
else
1820+
TRACE("dio", tout << "rs_g is zero: no improvement in the bound\n";);
18281821
}
18291822
return lia_move::undef;
18301823
}
@@ -1887,10 +1880,7 @@ namespace lp {
18871880
for (const auto& p: fixed_part_of_the_term) {
18881881
SASSERT(is_fixed(p.var()));
18891882
if (p.coeff().is_int() && (p.coeff() % g).is_zero()) {
1890-
// we can skip this dependency
1891-
// because the monomial p.coeff()*p.var() is 0 modulo g, and it does not matter that p.var() is fixed.
1892-
// We could have added p.coeff()*p.var() to g*t_, substructed the value of p.coeff()*p.var() from m_c and
1893-
// still get the same result.
1883+
// we can skip this dependency as explained above
18941884
TRACE("dio", tout << "skipped dep:\n"; print_deps(tout, lra.get_bound_constraint_witnesses_for_column(p.var())););
18951885
continue;
18961886
}
@@ -1966,7 +1956,7 @@ namespace lp {
19661956
return lia_move::undef;
19671957
if (r == lia_move::conflict || r == lia_move::undef)
19681958
break;
1969-
SASSERT(m_changed_columns.size() == 0);
1959+
SASSERT(m_changed_f_columns.size() == 0);
19701960
}
19711961
while (f_vector.size());
19721962

0 commit comments

Comments
 (0)