00001 /* Bit_Matrix class declaration. 00002 Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it> 00003 Copyright (C) 2010-2011 BUGSENG srl (http://bugseng.com) 00004 00005 This file is part of the Parma Polyhedra Library (PPL). 00006 00007 The PPL is free software; you can redistribute it and/or modify it 00008 under the terms of the GNU General Public License as published by the 00009 Free Software Foundation; either version 3 of the License, or (at your 00010 option) any later version. 00011 00012 The PPL is distributed in the hope that it will be useful, but WITHOUT 00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software Foundation, 00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. 00020 00021 For the most up-to-date information see the Parma Polyhedra Library 00022 site: http://www.cs.unipr.it/ppl/ . */ 00023 00024 #ifndef PPL_Bit_Matrix_defs_hh 00025 #define PPL_Bit_Matrix_defs_hh 1 00026 00027 #include "Bit_Matrix.types.hh" 00028 #include "Linear_System.defs.hh" 00029 #include "Bit_Row.defs.hh" 00030 #include <vector> 00031 #include <iosfwd> 00032 00033 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS 00034 00035 00036 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) 00037 class Parma_Polyhedra_Library::Bit_Matrix { 00038 public: 00040 Bit_Matrix(); 00041 00043 Bit_Matrix(dimension_type n_rows, dimension_type n_columns); 00044 00046 Bit_Matrix(const Bit_Matrix& y); 00047 00049 ~Bit_Matrix(); 00050 00052 Bit_Matrix& operator=(const Bit_Matrix& y); 00053 00055 void swap(Bit_Matrix& y); 00056 00058 Bit_Row& operator[](dimension_type k); 00059 00061 const Bit_Row& operator[](dimension_type k) const; 00062 00064 void clear(); 00065 00067 void transpose(); 00068 00070 void transpose_assign(const Bit_Matrix& y); 00071 00073 static dimension_type max_num_rows(); 00074 00076 dimension_type num_columns() const; 00077 00079 dimension_type num_rows() const; 00080 00082 void sort_rows(); 00083 00085 00095 bool sorted_contains(const Bit_Row& row) const; 00096 00098 00104 void add_recycled_row(Bit_Row& row); 00105 00107 void rows_erase_to_end(dimension_type first_to_erase); 00108 00110 void columns_erase_to_end(dimension_type first_to_erase); 00111 00113 void resize(dimension_type new_n_rows, dimension_type new_n_columns); 00114 00116 bool OK() const; 00117 00118 PPL_OUTPUT_DECLARATIONS 00119 00125 bool ascii_load(std::istream& s); 00126 00128 memory_size_type total_memory_in_bytes() const; 00129 00131 memory_size_type external_memory_in_bytes() const; 00132 00133 #ifndef NDEBUG 00134 00135 bool check_sorted() const; 00136 #endif 00137 00138 private: 00140 std::vector<Bit_Row> rows; 00141 00143 dimension_type row_size; 00144 00146 00147 struct Bit_Row_Less_Than { 00148 bool operator()(const Bit_Row& x, const Bit_Row& y) const; 00149 }; 00150 00151 friend 00152 void Parma_Polyhedra_Library:: 00153 Linear_System::sort_and_remove_with_sat(Bit_Matrix& sat); 00154 00155 }; 00156 00157 namespace Parma_Polyhedra_Library { 00158 00159 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS 00160 00161 00162 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) 00163 bool operator==(const Bit_Matrix& x, const Bit_Matrix& y); 00164 00165 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS 00166 00167 00168 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) 00169 bool operator!=(const Bit_Matrix& x, const Bit_Matrix& y); 00170 00171 } // namespace Parma_Polyhedra_Library 00172 00173 namespace std { 00174 00175 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS 00176 00177 00178 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) 00179 void swap(Parma_Polyhedra_Library::Bit_Matrix& x, 00180 Parma_Polyhedra_Library::Bit_Matrix& y); 00181 00182 } // namespace std 00183 00184 #include "Bit_Matrix.inlines.hh" 00185 00186 #endif // !defined(PPL_Bit_Matrix_defs_hh)
1.6.3