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