diff --git a/src/util/lp/binary_heap_priority_queue.h b/src/util/lp/binary_heap_priority_queue.h index 9a71fc01e..018d154ab 100644 --- a/src/util/lp/binary_heap_priority_queue.h +++ b/src/util/lp/binary_heap_priority_queue.h @@ -78,8 +78,6 @@ public: lp_assert(m_heap_size > 0); return m_heap[1]; } -#ifdef Z3DEBUG void print(std::ostream & out); -#endif }; } diff --git a/src/util/lp/binary_heap_priority_queue_def.h b/src/util/lp/binary_heap_priority_queue_def.h index 8a39ecdfa..232959c83 100644 --- a/src/util/lp/binary_heap_priority_queue_def.h +++ b/src/util/lp/binary_heap_priority_queue_def.h @@ -194,7 +194,6 @@ template unsigned binary_heap_priority_queue::dequeue() { m_heap_inverse[ret] = -1; return ret; } -#ifdef Z3DEBUG template void binary_heap_priority_queue::print(std::ostream & out) { vector index; vector prs; @@ -210,5 +209,4 @@ template void binary_heap_priority_queue::print(std::ostream & o for (int i = 0; i < index.size(); i++) enqueue(index[i], prs[i]); } -#endif } diff --git a/src/util/lp/general_matrix.h b/src/util/lp/general_matrix.h index 715f2cb08..ce510eb6e 100644 --- a/src/util/lp/general_matrix.h +++ b/src/util/lp/general_matrix.h @@ -71,7 +71,6 @@ public: ref_row operator[](unsigned i) { return ref_row(*this, m_data[adjust_row(i)]); } ref_row_const operator[](unsigned i) const { return ref_row_const(*this, m_data[adjust_row(i)]); } -#ifdef Z3DEBUG void print(std::ostream & out, unsigned blanks = 0) const { unsigned m = row_count(); unsigned n = column_count(); @@ -96,8 +95,6 @@ public: print_matrix(m.m_data, out, blanks); } -#endif - void clear() { m_data.clear(); } bool row_is_initialized_correctly(const vector& row) { diff --git a/src/util/lp/indexed_vector.cpp b/src/util/lp/indexed_vector.cpp index 180291705..11378f151 100644 --- a/src/util/lp/indexed_vector.cpp +++ b/src/util/lp/indexed_vector.cpp @@ -37,10 +37,10 @@ template bool indexed_vector::is_OK() const; template bool indexed_vector::is_OK() const; template bool indexed_vector::is_OK() const; template bool indexed_vector >::is_OK() const; +#endif template void lp::indexed_vector< lp::mpq>::print(std::basic_ostream > &); template void lp::indexed_vector::print(std::basic_ostream > &); template void lp::indexed_vector >::print(std::ostream&); -#endif } // template void lp::print_vector(vector const&, std::ostream&); // template void lp::print_vector(vector const&, std::ostream&); diff --git a/src/util/lp/indexed_vector.h b/src/util/lp/indexed_vector.h index d6ff4e76a..d472a4a1e 100644 --- a/src/util/lp/indexed_vector.h +++ b/src/util/lp/indexed_vector.h @@ -216,7 +216,7 @@ public: #ifdef Z3DEBUG bool is_OK() const; - void print(std::ostream & out); #endif + void print(std::ostream & out); }; } diff --git a/src/util/lp/indexed_vector_def.h b/src/util/lp/indexed_vector_def.h index 2f7706089..a133eb379 100644 --- a/src/util/lp/indexed_vector_def.h +++ b/src/util/lp/indexed_vector_def.h @@ -96,6 +96,7 @@ bool indexed_vector::is_OK() const { return true; } +#endif template void indexed_vector::print(std::ostream & out) { out << "m_index " << std::endl; @@ -105,6 +106,5 @@ void indexed_vector::print(std::ostream & out) { out << std::endl; print_vector(m_data, out); } -#endif } diff --git a/src/util/lp/lu.cpp b/src/util/lp/lu.cpp index e6df10908..ac29dd71a 100644 --- a/src/util/lp/lu.cpp +++ b/src/util/lp/lu.cpp @@ -42,11 +42,11 @@ template void init_factorization> template void init_factorization> (lu>*&, static_matrix&, vector&, lp_settings&); template void init_factorization>(lu >*&, static_matrix&, vector&, lp_settings&); -#ifdef Z3DEBUG template void print_matrix>(square_sparse_matrix&, std::ostream & out); template void print_matrix>(static_matrix&, std::ostream&); template void print_matrix >(static_matrix&, std::ostream&); template void print_matrix>(static_matrix&, std::ostream & out); +#ifdef Z3DEBUG template bool lu>::is_correct(const vector& basis); template bool lu>::is_correct( vector const &); template dense_matrix get_B>(lu>&, const vector& basis); diff --git a/src/util/lp/lu.h b/src/util/lp/lu.h index 820786d87..3b5a9cc59 100644 --- a/src/util/lp/lu.h +++ b/src/util/lp/lu.h @@ -39,15 +39,12 @@ Revision History: #include "util/lp/square_dense_submatrix.h" #include "util/lp/dense_matrix.h" namespace lp { -#ifdef Z3DEBUG template // print the nr x nc submatrix at the top left corner void print_submatrix(square_sparse_matrix & m, unsigned mr, unsigned nc); template void print_matrix(M &m, std::ostream & out); -#endif - template X dot_product(const vector & a, const vector & b) { lp_assert(a.size() == b.size()); diff --git a/src/util/lp/lu_def.h b/src/util/lp/lu_def.h index be4cd724d..51f291e7e 100644 --- a/src/util/lp/lu_def.h +++ b/src/util/lp/lu_def.h @@ -25,7 +25,6 @@ Revision History: #include "util/debug.h" #include "util/lp/lu.h" namespace lp { -#ifdef Z3DEBUG template // print the nr x nc submatrix at the top left corner void print_submatrix(square_sparse_matrix & m, unsigned mr, unsigned nc, std::ostream & out) { vector> A; @@ -62,9 +61,6 @@ void print_matrix(M &m, std::ostream & out) { print_matrix_with_widths(A, widths, out); } -#endif - - template one_elem_on_diag::one_elem_on_diag(const one_elem_on_diag & o) { m_i = o.m_i; diff --git a/src/util/lp/matrix.cpp b/src/util/lp/matrix.cpp index 2fb064111..7d3fba08d 100644 --- a/src/util/lp/matrix.cpp +++ b/src/util/lp/matrix.cpp @@ -18,14 +18,14 @@ Revision History: --*/ #include "util/lp/lp_settings.h" -#ifdef Z3DEBUG #include "util/lp/matrix_def.h" #include "util/lp/static_matrix.h" #include -template void lp::print_matrix(lp::matrix const*, std::ostream & out); +#ifdef Z3DEBUG template bool lp::matrix::is_equal(lp::matrix const&); -template void lp::print_matrix >(lp::matrix > const *, std::basic_ostream > &); -template void lp::print_matrix(lp::matrix const*, std::ostream&); template bool lp::matrix >::is_equal(lp::matrix > const&); template bool lp::matrix::is_equal(lp::matrix const&); #endif +template void lp::print_matrix(lp::matrix const*, std::ostream & out); +template void lp::print_matrix >(lp::matrix > const *, std::basic_ostream > &); +template void lp::print_matrix(lp::matrix const*, std::ostream&); diff --git a/src/util/lp/matrix.h b/src/util/lp/matrix.h index 063513287..8b2fc4220 100644 --- a/src/util/lp/matrix.h +++ b/src/util/lp/matrix.h @@ -17,7 +17,6 @@ Revision History: --*/ -#ifdef Z3DEBUG #pragma once #include "util/lp/numeric_pair.h" #include "util/vector.h" @@ -70,4 +69,3 @@ void print_matrix(const vector> & A, std::ostream & out, unsigned blan } -#endif diff --git a/src/util/lp/matrix_def.h b/src/util/lp/matrix_def.h index ae5f05ad1..361540cae 100644 --- a/src/util/lp/matrix_def.h +++ b/src/util/lp/matrix_def.h @@ -18,11 +18,11 @@ Revision History: --*/ -#ifdef Z3DEBUG #include #include #include "util/lp/matrix.h" namespace lp { +#ifdef Z3DEBUG template bool matrix::is_equal(const matrix& other) { if (other.row_count() != row_count() || other.column_count() != column_count()) @@ -67,7 +67,7 @@ void apply_to_vector(matrix & m, T * w) { delete [] wc; } - +#endif unsigned get_width_of_column(unsigned j, vector> & A) { unsigned r = 0; @@ -132,4 +132,3 @@ void print_matrix(matrix const * m, std::ostream & out) { } } -#endif diff --git a/src/util/lp/square_sparse_matrix.h b/src/util/lp/square_sparse_matrix.h index d84a8a289..cb5193b2d 100644 --- a/src/util/lp/square_sparse_matrix.h +++ b/src/util/lp/square_sparse_matrix.h @@ -40,9 +40,7 @@ namespace lp { // it is a square matrix template class square_sparse_matrix -#ifdef Z3DEBUG : public matrix -#endif { struct col_header { unsigned m_shortened_markovitz; @@ -173,10 +171,8 @@ public: unsigned dimension() const {return static_cast(m_row_permutation.size());} -#ifdef Z3DEBUG unsigned row_count() const override {return dimension();} unsigned column_count() const override {return dimension();} -#endif void init_row_headers(); @@ -309,13 +305,11 @@ public: template void solve_U_y_indexed_only(indexed_vector & y, const lp_settings&, vector & sorted_active_rows ); -#ifdef Z3DEBUG T get_elem(unsigned i, unsigned j) const override { return get(i, j); } unsigned get_number_of_rows() const { return dimension(); } unsigned get_number_of_columns() const { return dimension(); } void set_number_of_rows(unsigned /*m*/) override { } void set_number_of_columns(unsigned /*n*/) override { } -#endif template L dot_product_with_row (unsigned row, const vector & y) const;