00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PPL_Congruence_System_inlines_hh
00025 #define PPL_Congruence_System_inlines_hh 1
00026
00027 #include "Congruence.defs.hh"
00028
00029 namespace Parma_Polyhedra_Library {
00030
00031 inline Congruence&
00032 Congruence_System::operator[](const dimension_type k) {
00033 return static_cast<Congruence&>(Matrix::operator[](k));
00034 }
00035
00036 inline const Congruence&
00037 Congruence_System::operator[](const dimension_type k) const {
00038 return static_cast<const Congruence&>(Matrix::operator[](k));
00039 }
00040
00041 inline void
00042 Congruence_System::insert(const Congruence& cg) {
00043 insert_verbatim(cg);
00044 static_cast<Congruence&>(operator[](rows.size()-1)).strong_normalize();
00045 PPL_ASSERT(OK());
00046 }
00047
00048 inline
00049 Congruence_System::Congruence_System()
00050 : Matrix(0, 2) {
00051 }
00052
00053 inline
00054 Congruence_System::Congruence_System(const Congruence& cg)
00055 : Matrix(0, 2) {
00056 insert(cg);
00057 }
00058
00059 inline
00060 Congruence_System::Congruence_System(const Constraint& c)
00061 : Matrix(0, 2) {
00062 insert(c);
00063 }
00064
00065 inline
00066 Congruence_System::Congruence_System(const Congruence_System& cs)
00067 : Matrix(cs) {
00068 }
00069
00070 inline
00071 Congruence_System::Congruence_System(const dimension_type d)
00072 : Matrix(0, d + 2) {
00073 }
00074
00075 inline
00076 Congruence_System::~Congruence_System() {
00077 }
00078
00079 inline Congruence_System&
00080 Congruence_System::operator=(const Congruence_System& y) {
00081 Matrix::operator=(y);
00082 return *this;
00083 }
00084
00085 inline dimension_type
00086 Congruence_System::max_space_dimension() {
00087 return Matrix::max_num_columns() - 2;
00088 }
00089
00090 inline dimension_type
00091 Congruence_System::space_dimension() const {
00092 return Matrix::num_columns() - 2;
00093 }
00094
00095 inline void
00096 Congruence_System::clear() {
00097 Matrix::clear();
00098 add_zero_columns(2);
00099 }
00100
00101 inline void
00102 Congruence_System::resize_no_copy(const dimension_type new_num_rows,
00103 const dimension_type new_num_columns) {
00104 Matrix::resize_no_copy(new_num_rows, new_num_columns, Row::Flags());
00105 }
00106
00107 inline const Congruence_System&
00108 Congruence_System::zero_dim_empty() {
00109 PPL_ASSERT(zero_dim_empty_p != 0);
00110 return *zero_dim_empty_p;
00111 }
00112
00113 inline
00114 Congruence_System::const_iterator::const_iterator()
00115 : i(), csp(0) {
00116 }
00117
00118 inline
00119 Congruence_System::const_iterator::const_iterator(const const_iterator& y)
00120 : i(y.i), csp(y.csp) {
00121 }
00122
00123 inline
00124 Congruence_System::const_iterator::~const_iterator() {
00125 }
00126
00127 inline Congruence_System::const_iterator&
00128 Congruence_System::const_iterator::operator=(const const_iterator& y) {
00129 i = y.i;
00130 csp = y.csp;
00131 return *this;
00132 }
00133
00134 inline const Congruence&
00135 Congruence_System::const_iterator::operator*() const {
00136 return static_cast<const Congruence&>(*i);
00137 }
00138
00139 inline const Congruence*
00140 Congruence_System::const_iterator::operator->() const {
00141 return static_cast<const Congruence*>(i.operator->());
00142 }
00143
00144 inline Congruence_System::const_iterator&
00145 Congruence_System::const_iterator::operator++() {
00146 ++i;
00147 skip_forward();
00148 return *this;
00149 }
00150
00151 inline Congruence_System::const_iterator
00152 Congruence_System::const_iterator::operator++(int) {
00153 const const_iterator tmp = *this;
00154 operator++();
00155 return tmp;
00156 }
00157
00158 inline bool
00159 Congruence_System::const_iterator::operator==(const const_iterator& y) const {
00160 return i == y.i;
00161 }
00162
00163 inline bool
00164 Congruence_System::const_iterator::operator!=(const const_iterator& y) const {
00165 return i != y.i;
00166 }
00167
00168 inline
00169 Congruence_System::const_iterator::
00170 const_iterator(const Matrix::const_iterator& iter,
00171 const Congruence_System& csys)
00172 : i(iter), csp(&csys) {
00173 }
00174
00175 inline Congruence_System::const_iterator
00176 Congruence_System::begin() const {
00177 const_iterator i(Matrix::begin(), *this);
00178 i.skip_forward();
00179 return i;
00180 }
00181
00182 inline Congruence_System::const_iterator
00183 Congruence_System::end() const {
00184 const const_iterator i(Matrix::end(), *this);
00185 return i;
00186 }
00187
00188 inline bool
00189 Congruence_System::empty() const {
00190 return begin() == end();
00191 }
00192
00193 inline void
00194 Congruence_System::swap(Congruence_System& y) {
00195 Matrix::swap(y);
00196 }
00197
00198 inline memory_size_type
00199 Congruence_System::external_memory_in_bytes() const {
00200 return Matrix::external_memory_in_bytes();
00201 }
00202
00203 inline memory_size_type
00204 Congruence_System::total_memory_in_bytes() const {
00205 return Matrix::total_memory_in_bytes();
00206 }
00207
00208 }
00209
00210
00211 namespace std {
00212
00214 inline void
00215 swap(Parma_Polyhedra_Library::Congruence_System& x,
00216 Parma_Polyhedra_Library::Congruence_System& y) {
00217 x.swap(y);
00218 }
00219
00220 }
00221
00222 #endif // !defined(PPL_Congruence_System_inlines_hh)