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