00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PPL_Saturation_Row_defs_hh
00024 #define PPL_Saturation_Row_defs_hh 1
00025
00026 #include "Saturation_Row.types.hh"
00027 #include "globals.types.hh"
00028 #include <iosfwd>
00029 #include <gmp.h>
00030 #include <vector>
00031
00032 namespace Parma_Polyhedra_Library {
00033
00034
00035
00036 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00038
00039 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00040 bool operator==(const Saturation_Row& x, const Saturation_Row& y);
00041
00042 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00044
00045 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00046 bool operator!=(const Saturation_Row& x, const Saturation_Row& y);
00047
00048 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00050
00061 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00062 int compare(const Saturation_Row& x, const Saturation_Row& y);
00063
00064 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00066
00067 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00068 bool subset_or_equal(const Saturation_Row& x, const Saturation_Row& y);
00069
00070 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00071
00077 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00078 bool subset_or_equal(const Saturation_Row& x, const Saturation_Row& y,
00079 bool& strict_subset);
00080
00081 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00083
00084 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00085 bool strict_subset(const Saturation_Row& x, const Saturation_Row& y);
00086
00087 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00089
00090 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00091 void set_union(const Saturation_Row& x,
00092 const Saturation_Row& y,
00093 Saturation_Row& z);
00094
00095 }
00096
00097 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00099
00111 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00112 class Parma_Polyhedra_Library::Saturation_Row {
00113 public:
00115 Saturation_Row();
00116
00118 Saturation_Row(const Saturation_Row& y);
00119
00121 ~Saturation_Row();
00122
00124 Saturation_Row& operator=(const Saturation_Row& y);
00125
00127 void swap(Saturation_Row& y);
00128
00130 bool operator[](unsigned long k) const;
00131
00133 void set(unsigned long k);
00134
00136 void clear(unsigned long k);
00137
00139 void clear_from(unsigned long k);
00140
00142 void clear();
00143
00144 friend int
00145 Parma_Polyhedra_Library::compare(const Saturation_Row& x,
00146 const Saturation_Row& y);
00147
00148 friend bool
00149 Parma_Polyhedra_Library::operator==(const Saturation_Row& x,
00150 const Saturation_Row& y);
00151
00152 friend bool
00153 Parma_Polyhedra_Library::operator!=(const Saturation_Row& x,
00154 const Saturation_Row& y);
00155
00156 friend bool
00157 Parma_Polyhedra_Library::subset_or_equal(const Saturation_Row& x,
00158 const Saturation_Row& y);
00159
00160 friend bool
00161 Parma_Polyhedra_Library::subset_or_equal(const Saturation_Row& x,
00162 const Saturation_Row& y,
00163 bool& strict_subset);
00164
00165 friend bool
00166 Parma_Polyhedra_Library::strict_subset(const Saturation_Row& x,
00167 const Saturation_Row& y);
00168
00169 friend void
00170 Parma_Polyhedra_Library::set_union(const Saturation_Row& x,
00171 const Saturation_Row& y,
00172 Saturation_Row& z);
00173
00175 unsigned long first() const;
00176
00181 unsigned long next(unsigned long position) const;
00182
00184 unsigned long last() const;
00185
00190 unsigned long prev(unsigned long position) const;
00191
00193 unsigned long count_ones() const;
00194
00196 bool empty() const;
00197
00199 memory_size_type total_memory_in_bytes() const;
00200
00202 memory_size_type external_memory_in_bytes() const;
00203
00205 bool OK() const;
00206
00207 private:
00209 mpz_t vec;
00210
00212 static unsigned int first_one(mp_limb_t w);
00213
00215 static unsigned int last_one(mp_limb_t w);
00216 };
00217
00218 namespace std {
00219
00220 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00222
00223 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00224 void swap(Parma_Polyhedra_Library::Saturation_Row& x,
00225 Parma_Polyhedra_Library::Saturation_Row& y);
00226
00227 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00229
00230 #endif // PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00231 void
00232 iter_swap(std::vector<Parma_Polyhedra_Library::Saturation_Row>::iterator x,
00233 std::vector<Parma_Polyhedra_Library::Saturation_Row>::iterator y);
00234
00235 }
00236
00237 #include "Saturation_Row.inlines.hh"
00238
00239 #endif // !defined(PPL_Saturation_Row_defs_hh)