@@ -494,7 +494,10 @@ namespace lp {
494
494
// m_column_to_terms[j] is the set of all k such lra.get_term(k) depends on j
495
495
std::unordered_map<unsigned , std::unordered_set<unsigned >> m_columns_to_terms;
496
496
497
- unsigned m_conflict_index = -1 ; // the row index of the conflict
497
+ unsigned m_conflict_index = UINT_MAX; // the row index of the conflict
498
+ void reset_conflict () { m_conflict_index = UINT_MAX; }
499
+ bool has_conflict () const { return m_conflict_index == UINT_MAX; }
500
+ void set_rewrite_conflict (unsigned idx) { SASSERT (idx != UINT_MAX); m_conflict_index = idx; lra.stats ().m_dio_rewrite_conflicts ++; }
498
501
unsigned m_max_of_branching_iterations = 0 ;
499
502
unsigned m_number_of_branching_calls;
500
503
struct branch {
@@ -1102,12 +1105,12 @@ namespace lp {
1102
1105
1103
1106
void init (std_vector<unsigned > & f_vector) {
1104
1107
m_report_branch = false ;
1105
- m_conflict_index = -1 ;
1106
1108
m_infeas_explanation.clear ();
1107
1109
lia.get_term ().clear ();
1108
1110
m_number_of_branching_calls = 0 ;
1109
1111
m_branch_stack.clear ();
1110
1112
m_lra_level = 0 ;
1113
+ reset_conflict ();
1111
1114
1112
1115
process_changed_columns (f_vector);
1113
1116
for (const lar_term* t : m_added_terms) {
@@ -1757,7 +1760,7 @@ namespace lp {
1757
1760
continue ;
1758
1761
}
1759
1762
else {
1760
- m_conflict_index = ei ;
1763
+ set_rewrite_conflict (ei) ;
1761
1764
return ;
1762
1765
}
1763
1766
}
@@ -1766,10 +1769,8 @@ namespace lp {
1766
1769
}
1767
1770
1768
1771
lia_move process_f (std_vector<unsigned >& f_vector) {
1769
- if (m_conflict_index != UINT_MAX) {
1770
- lra.stats ().m_dio_rewrite_conflicts ++;
1772
+ if (has_conflict ())
1771
1773
return lia_move::conflict;
1772
- }
1773
1774
lia_move r;
1774
1775
do {
1775
1776
r = rewrite_eqs (f_vector);
@@ -1782,9 +1783,6 @@ namespace lp {
1782
1783
while (f_vector.size ());
1783
1784
1784
1785
if (r == lia_move::conflict) {
1785
- if (m_conflict_index != UINT_MAX) {
1786
- lra.stats ().m_dio_rewrite_conflicts ++;
1787
- }
1788
1786
return lia_move::conflict;
1789
1787
}
1790
1788
TRACE (" dio_s" , print_S (tout));
@@ -2559,15 +2557,15 @@ namespace lp {
2559
2557
continue ;
2560
2558
}
2561
2559
else {
2562
- m_conflict_index = ei ;
2560
+ set_rewrite_conflict (ei) ;
2563
2561
return lia_move::conflict;
2564
2562
}
2565
2563
}
2566
2564
2567
2565
auto [ahk, k, k_sign, markovich_number] = find_minimal_abs_coeff (ei);
2568
2566
mpq gcd;
2569
2567
if (!normalize_e_by_gcd (ei, gcd)) {
2570
- m_conflict_index = ei ;
2568
+ set_rewrite_conflict (ei) ;
2571
2569
return lia_move::conflict;
2572
2570
}
2573
2571
if (!gcd.is_one ())
@@ -2616,7 +2614,7 @@ namespace lp {
2616
2614
2617
2615
public:
2618
2616
void explain (explanation& ex) {
2619
- if (m_conflict_index == UINT_MAX ) {
2617
+ if (! has_conflict () ) {
2620
2618
for (auto ci : m_infeas_explanation) {
2621
2619
ex.push_back (ci.ci ());
2622
2620
}
0 commit comments