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_Constraint_System_inlines_hh
00025 #define PPL_Constraint_System_inlines_hh 1
00026
00027 #include "Constraint.defs.hh"
00028
00029 namespace Parma_Polyhedra_Library {
00030
00031 inline
00032 Constraint_System::Constraint_System()
00033 : Linear_System(NECESSARILY_CLOSED) {
00034 }
00035
00036 inline
00037 Constraint_System::Constraint_System(const Constraint& c)
00038 : Linear_System(c.topology()) {
00039 Linear_System::insert(c);
00040 }
00041
00042 inline
00043 Constraint_System::Constraint_System(const Constraint_System& cs)
00044 : Linear_System(cs) {
00045 }
00046
00047 inline
00048 Constraint_System::Constraint_System(const Topology topol)
00049 : Linear_System(topol) {
00050 }
00051
00052 inline
00053 Constraint_System::Constraint_System(const Topology topol,
00054 const dimension_type n_rows,
00055 const dimension_type n_columns)
00056 : Linear_System(topol, n_rows, n_columns) {
00057 }
00058
00059 inline
00060 Constraint_System::~Constraint_System() {
00061 }
00062
00063 inline Constraint_System&
00064 Constraint_System::operator=(const Constraint_System& y) {
00065 Linear_System::operator=(y);
00066 return *this;
00067 }
00068
00069 inline Constraint&
00070 Constraint_System::operator[](const dimension_type k) {
00071 return static_cast<Constraint&>(Linear_System::operator[](k));
00072 }
00073
00074 inline const Constraint&
00075 Constraint_System::operator[](const dimension_type k) const {
00076 return static_cast<const Constraint&>(Linear_System::operator[](k));
00077 }
00078
00079 inline dimension_type
00080 Constraint_System::max_space_dimension() {
00081 return Linear_System::max_space_dimension();
00082 }
00083
00084 inline dimension_type
00085 Constraint_System::space_dimension() const {
00086 return Linear_System::space_dimension();
00087 }
00088
00089 inline void
00090 Constraint_System::clear() {
00091 Linear_System::clear();
00092 }
00093
00094 inline const Constraint_System&
00095 Constraint_System::zero_dim_empty() {
00096 PPL_ASSERT(zero_dim_empty_p != 0);
00097 return *zero_dim_empty_p;
00098 }
00099
00100 inline
00101 Constraint_System::const_iterator::const_iterator()
00102 : i(), csp(0) {
00103 }
00104
00105 inline
00106 Constraint_System::const_iterator::const_iterator(const const_iterator& y)
00107 : i(y.i), csp(y.csp) {
00108 }
00109
00110 inline
00111 Constraint_System::const_iterator::~const_iterator() {
00112 }
00113
00114 inline Constraint_System::const_iterator&
00115 Constraint_System::const_iterator::operator=(const const_iterator& y) {
00116 i = y.i;
00117 csp = y.csp;
00118 return *this;
00119 }
00120
00121 inline const Constraint&
00122 Constraint_System::const_iterator::operator*() const {
00123 return static_cast<const Constraint&>(*i);
00124 }
00125
00126 inline const Constraint*
00127 Constraint_System::const_iterator::operator->() const {
00128 return static_cast<const Constraint*>(i.operator->());
00129 }
00130
00131 inline Constraint_System::const_iterator&
00132 Constraint_System::const_iterator::operator++() {
00133 ++i;
00134 skip_forward();
00135 return *this;
00136 }
00137
00138 inline Constraint_System::const_iterator
00139 Constraint_System::const_iterator::operator++(int) {
00140 const const_iterator tmp = *this;
00141 operator++();
00142 return tmp;
00143 }
00144
00145 inline bool
00146 Constraint_System::const_iterator::operator==(const const_iterator& y) const {
00147 return i == y.i;
00148 }
00149
00150 inline bool
00151 Constraint_System::const_iterator::operator!=(const const_iterator& y) const {
00152 return i != y.i;
00153 }
00154
00155 inline
00156 Constraint_System::const_iterator::
00157 const_iterator(const Linear_System::const_iterator& iter,
00158 const Constraint_System& csys)
00159 : i(iter), csp(&csys) {
00160 }
00161
00162 inline Constraint_System::const_iterator
00163 Constraint_System::begin() const {
00164 const_iterator i(Linear_System::begin(), *this);
00165 i.skip_forward();
00166 return i;
00167 }
00168
00169 inline Constraint_System::const_iterator
00170 Constraint_System::end() const {
00171 const const_iterator i(Linear_System::end(), *this);
00172 return i;
00173 }
00174
00175 inline bool
00176 Constraint_System::empty() const {
00177 return begin() == end();
00178 }
00179
00180 inline void
00181 Constraint_System::add_low_level_constraints() {
00182 if (is_necessarily_closed())
00183
00184 insert(Constraint::zero_dim_positivity());
00185 else {
00186
00187 insert(Constraint::epsilon_leq_one());
00188 insert(Constraint::epsilon_geq_zero());
00189 }
00190 }
00191
00192 inline void
00193 Constraint_System::swap(Constraint_System& y) {
00194 Linear_System::swap(y);
00195 }
00196
00197 inline memory_size_type
00198 Constraint_System::external_memory_in_bytes() const {
00199 return Linear_System::external_memory_in_bytes();
00200 }
00201
00202 inline memory_size_type
00203 Constraint_System::total_memory_in_bytes() const {
00204 return Linear_System::total_memory_in_bytes();
00205 }
00206
00207 inline void
00208 Constraint_System::simplify() {
00209 Linear_System::simplify();
00210 }
00211
00212 }
00213
00214
00215 namespace std {
00216
00218 inline void
00219 swap(Parma_Polyhedra_Library::Constraint_System& x,
00220 Parma_Polyhedra_Library::Constraint_System& y) {
00221 x.swap(y);
00222 }
00223
00224 }
00225
00226 #endif // !defined(PPL_Constraint_System_inlines_hh)