Skip to content

Commit 45ad614

Browse files
added logging
1 parent 1fec0fa commit 45ad614

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

src/math/lp/dioph_eq.cpp

+34-12
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,22 @@ namespace lp {
246246
std::ostream& print_S(std::ostream& out) {
247247
out << "S:\n";
248248
for (const auto& p : m_k2s.m_map) {
249-
print_entry(p.second, out);
249+
print_entry(p.second, out, false, false);
250+
}
251+
return out;
252+
}
253+
254+
std::ostream& print_bounds(std::ostream& out) {
255+
out << "bounds:\n";
256+
for (unsigned v = 0; v < m_var_register.size(); ++v) {
257+
unsigned j = m_var_register.local_to_external(v);
258+
out << "j" << j << ": ";
259+
if (lra.column_has_lower_bound(j))
260+
out << lra.column_lower_bound(j).x << " <= ";
261+
out << "x" << v;
262+
if (lra.column_has_upper_bound(j))
263+
out << " <= " << lra.column_upper_bound(j).x;
264+
out << "\n";
250265
}
251266
return out;
252267
}
@@ -1384,21 +1399,25 @@ namespace lp {
13841399

13851400
lia_move r = lia_move::undef;
13861401
// Process sorted terms
1402+
TRACE("dio",
1403+
tout << "changed terms:"; for (auto j : sorted_changed_terms) tout << j << " "; tout << std::endl;
1404+
print_S(tout);
1405+
print_bounds(tout);
1406+
);
13871407
for (unsigned j : sorted_changed_terms) {
1388-
m_changed_terms.remove(j);
1389-
1390-
1408+
m_changed_terms.remove(j);
13911409
if (tighten_bounds_for_term_column(j)) {
1410+
TRACE("dio", tout << "tighten j:" << j << std::endl;);
13921411
r = lia_move::conflict;
13931412
break;
13941413
}
13951414
}
1396-
for (unsigned j : cleanup) {
1397-
m_changed_terms.remove(j);
1398-
}
1415+
for (unsigned j : cleanup)
1416+
m_changed_terms.remove(j);
13991417
return r;
14001418
}
14011419

1420+
#if 0
14021421
std::ostream& print_queue(std::queue<unsigned> q, std::ostream& out) {
14031422
out << "qu: ";
14041423
while (!q.empty()) {
@@ -1408,6 +1427,7 @@ namespace lp {
14081427
out << std::endl;
14091428
return out;
14101429
}
1430+
#endif
14111431

14121432
term_o create_term_from_ind_c() {
14131433
term_o t;
@@ -2321,10 +2341,13 @@ namespace lp {
23212341
}
23222342

23232343
std::ostream& print_entry(unsigned i, std::ostream& out,
2324-
bool print_dep = false) {
2325-
out << "entry " << i << ":";
2344+
bool print_dep = false, bool print_in_S = true) {
2345+
unsigned j = m_k2s.has_val(i) ? m_k2s.get_key(i) : UINT_MAX;
2346+
out << "entry " << i << ": ";
2347+
if (j != UINT_MAX)
2348+
out << "x" << j << " ";
23262349
out << "{\n";
2327-
print_term_o(get_term_from_entry(i), out << "\tm_e:") << ",\n";
2350+
print_term_o(get_term_from_entry(i), out << "\t") << ",\n";
23282351
// out << "\tstatus:" << (int)e.m_entry_status;
23292352
if (print_dep) {
23302353
auto l_term = l_term_from_row(i);
@@ -2339,11 +2362,10 @@ namespace lp {
23392362
out << "in F\n";
23402363
}
23412364
else {
2342-
unsigned j = m_k2s.get_key(i);
23432365
if (local_to_lar_solver(j) == UINT_MAX) {
23442366
out << "FRESH\n";
23452367
}
2346-
else {
2368+
else if (print_in_S) {
23472369
out << "in S\n";
23482370
}
23492371
}

0 commit comments

Comments
 (0)