From 181bb60e363e5aaebd87d9286465da8da2ee53a1 Mon Sep 17 00:00:00 2001 From: Lev Date: Mon, 30 Jul 2018 12:54:53 -0700 Subject: [PATCH] remove some lp_asserts Signed-off-by: Lev --- src/util/lp/lp_core_solver_base.h | 1 - src/util/lp/lp_core_solver_base_def.h | 1 - src/util/lp/static_matrix.h | 2 -- src/util/lp/static_matrix_def.h | 4 ++-- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/util/lp/lp_core_solver_base.h b/src/util/lp/lp_core_solver_base.h index 5bde78ca8..fbb08edfe 100644 --- a/src/util/lp/lp_core_solver_base.h +++ b/src/util/lp/lp_core_solver_base.h @@ -209,7 +209,6 @@ public: bool need_to_pivot_to_basis_tableau() const { - lp_assert(m_A.is_correct()); unsigned m = m_A.row_count(); for (unsigned i = 0; i < m; i++) { unsigned bj = m_basis[i]; diff --git a/src/util/lp/lp_core_solver_base_def.h b/src/util/lp/lp_core_solver_base_def.h index f9c1ae632..8cfc39170 100644 --- a/src/util/lp/lp_core_solver_base_def.h +++ b/src/util/lp/lp_core_solver_base_def.h @@ -621,7 +621,6 @@ divide_row_by_pivot(unsigned pivot_row, unsigned pivot_col) { } template bool lp_core_solver_base:: pivot_column_tableau(unsigned j, unsigned piv_row_index) { - lp_assert(m_A.is_correct()); m_A.compress_row_if_needed(piv_row_index); if (!divide_row_by_pivot(piv_row_index, j)) return false; diff --git a/src/util/lp/static_matrix.h b/src/util/lp/static_matrix.h index c75fa4ce8..e3ea3c1b0 100644 --- a/src/util/lp/static_matrix.h +++ b/src/util/lp/static_matrix.h @@ -790,12 +790,10 @@ public: void compress_row_if_needed(unsigned i) { compress_cells(m_rows[i], m_columns); - lp_assert(is_correct()); } void compress_column_if_needed(unsigned j) { compress_cells(m_columns[j], m_rows); - lp_assert(is_correct()); } ref_row operator[](unsigned i) const { return ref_row(*this, i);} diff --git a/src/util/lp/static_matrix_def.h b/src/util/lp/static_matrix_def.h index 698363289..ae0e22540 100644 --- a/src/util/lp/static_matrix_def.h +++ b/src/util/lp/static_matrix_def.h @@ -44,7 +44,6 @@ template void static_matrix::scan_row_ii_to_offse template bool static_matrix::pivot_row_to_row_given_cell(unsigned i, column_cell & c, unsigned pivot_col) { - lp_assert(is_correct()); unsigned ii = c.var(); lp_assert(i < row_count() && ii < column_count() && i != ii); T alpha = -get_val(c); @@ -83,7 +82,6 @@ template bool static_matrix::pivot_row_to_row_giv if (is_zero(c.coeff())) remove_element(c); } - lp_assert(is_correct()); return !rowii.empty(); } @@ -295,6 +293,8 @@ template T static_matrix::get_row_balance(unsi } template bool static_matrix::is_correct() const { + if (m_rows.size() > 100 || m_columns.size() > 100) + return true; for (unsigned i = 0; i < m_rows.size(); i++) { auto &r = m_rows[i]; std::unordered_set s;