@@ -63,7 +63,7 @@ namespace lp {
6363 return m_rev_map.find (b)->second ;
6464 }
6565
66- unsigned size () const {return m_map.size ();}
66+ unsigned size () const {return static_cast < unsigned >( m_map.size () );}
6767
6868 void erase_val (unsigned b) {
6969 SASSERT (contains (m_rev_map, b) && contains (m_map, m_rev_map[b]));
@@ -340,7 +340,7 @@ namespace lp {
340340 TRACE (" d_undo" , tout << " t:" << t<<" , t->j():" << t->j () << std::endl;);
341341 TRACE (" dioph_eq" , lra.print_term (*t, tout); tout << " , t->j() =" << t->j () << std::endl;);
342342 if (!contains (m_active_terms, t)) {
343- for (int i = m_added_terms.size () - 1 ; i >= 0 ; --i) {
343+ for (int i = static_cast < int >( m_added_terms.size () - 1 ) ; i >= 0 ; --i) {
344344 if (m_added_terms[i] != t) continue ;
345345 if ((unsigned )i != m_added_terms.size () -1 )
346346 m_added_terms[i] = m_added_terms.back ();
@@ -388,7 +388,7 @@ namespace lp {
388388 };
389389
390390 void remove_last_entry () {
391- unsigned ei = m_entries.size () - 1 ;
391+ unsigned ei = static_cast < unsigned >( m_entries.size () - 1 ) ;
392392
393393 if (m_k2s.has_val (ei)) {
394394 remove_from_S (ei);
@@ -487,7 +487,7 @@ namespace lp {
487487
488488 void remove_last_row_in_matrix (static_matrix<mpq, mpq>& m) {
489489 auto & last_row = m.m_rows .back ();
490- for (unsigned k = last_row.size (); k-- > 0 ;) {
490+ for (unsigned k = static_cast < unsigned >( last_row.size () ); k-- > 0 ;) {
491491 m.remove_element (last_row, last_row[k]);
492492 }
493493 m.m_rows .pop_back ();
@@ -609,6 +609,7 @@ namespace lp {
609609 SASSERT (entry_invariant (entry_index));
610610 }
611611 void subs_entry (unsigned ei) {
612+ if (ei >= m_entries.size ()) return ;
612613 std::queue<unsigned > q;
613614 for (const auto & p: m_e_matrix.m_rows [ei]) {
614615 if (can_substitute (p.var ()))
@@ -754,9 +755,9 @@ namespace lp {
754755 fresh_entries_to_remove.pop_back ();
755756 const fresh_definition & fd = m_fresh_definitions[xt];
756757 TRACE (" d_once" , print_entry (fd.m_ei , tout) << std::endl; tout << " xt:" << xt << std::endl;);
757- unsigned last_ei = m_entries.size () - 1 ;
758+ unsigned last_ei = static_cast < unsigned >( m_entries.size () - 1 ) ;
758759 if (fd.m_ei != last_ei) { // not the last entry
759- transpose_entries (fd.m_ei , m_entries.size () -1 );
760+ transpose_entries (fd.m_ei , static_cast < unsigned >( m_entries.size () - 1 ) );
760761 // we are not going to recalculate fd.m_ei
761762 // but we might need to recalculate last_ei, which becomes fd.m_ei
762763 if (contains (entries_to_recalculate, last_ei )) {
@@ -1786,7 +1787,7 @@ namespace lp {
17861787 pivot_col_cell_index;
17871788 }
17881789
1789- unsigned cell_to_process = column.size () - 1 ;
1790+ unsigned cell_to_process = static_cast < unsigned >( column.size () - 1 ) ;
17901791 while (cell_to_process > 0 ) {
17911792 auto & c = column[cell_to_process];
17921793 if (belongs_to_s (c.var ())) {
0 commit comments