00001 /* Grid_Generator_System class implementation: inline functions. 00002 Copyright (C) 2001-2008 Roberto Bagnara <bagnara@cs.unipr.it> 00003 00004 This file is part of the Parma Polyhedra Library (PPL). 00005 00006 The PPL is free software; you can redistribute it and/or modify it 00007 under the terms of the GNU General Public License as published by the 00008 Free Software Foundation; either version 3 of the License, or (at your 00009 option) any later version. 00010 00011 The PPL is distributed in the hope that it will be useful, but WITHOUT 00012 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00013 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00014 for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software Foundation, 00018 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. 00019 00020 For the most up-to-date information see the Parma Polyhedra Library 00021 site: http://www.cs.unipr.it/ppl/ . */ 00022 00023 #ifndef PPL_Grid_Generator_System_inlines_hh 00024 #define PPL_Grid_Generator_System_inlines_hh 1 00025 00026 #include "Grid_Generator.defs.hh" 00027 #include "Generator_System.inlines.hh" 00028 00029 namespace Parma_Polyhedra_Library { 00030 00031 inline void 00032 Grid_Generator_System::set_sorted(bool b) { 00033 Generator_System::set_sorted(b); 00034 } 00035 00036 inline void 00037 Grid_Generator_System::unset_pending_rows() { 00038 Generator_System::unset_pending_rows(); 00039 } 00040 00041 inline void 00042 Grid_Generator_System::set_index_first_pending_row(const dimension_type i) { 00043 Generator_System::set_index_first_pending_row(i); 00044 } 00045 00046 inline void 00047 Grid_Generator_System::resize_no_copy(const dimension_type new_num_rows, 00048 const dimension_type new_num_columns) { 00049 Generator_System::resize_no_copy(new_num_rows, new_num_columns); 00050 } 00051 00052 inline dimension_type 00053 Grid_Generator_System::num_columns() const { 00054 return Generator_System::num_columns(); 00055 } 00056 00057 inline void 00058 Grid_Generator_System::erase_to_end(dimension_type first_to_erase) { 00059 return Generator_System::erase_to_end(first_to_erase); 00060 } 00061 00062 inline void 00063 Grid_Generator_System 00064 ::permute_columns(const std::vector<dimension_type>& cycles) { 00065 return Generator_System::permute_columns(cycles); 00066 } 00067 00068 inline bool 00069 Grid_Generator_System::is_equal_to(const Grid_Generator_System& y) const { 00070 return operator==(static_cast<const Generator_System&>(*this), 00071 static_cast<const Generator_System&>(y)); 00072 } 00073 00074 inline 00075 Grid_Generator_System::Grid_Generator_System() 00076 : Generator_System(NECESSARILY_CLOSED) { 00077 adjust_topology_and_space_dimension(NECESSARILY_CLOSED, 1); 00078 set_sorted(false); 00079 } 00080 00081 inline 00082 Grid_Generator_System::Grid_Generator_System(const Grid_Generator_System& gs) 00083 : Generator_System(gs) { 00084 } 00085 00086 inline 00087 Grid_Generator_System::Grid_Generator_System(dimension_type dim) 00088 : Generator_System(NECESSARILY_CLOSED) { 00089 adjust_topology_and_space_dimension(NECESSARILY_CLOSED, dim + 1); 00090 set_sorted(false); 00091 } 00092 00093 inline 00094 Grid_Generator_System::Grid_Generator_System(const Grid_Generator& g) 00095 : Generator_System(g) { 00096 set_sorted(false); 00097 } 00098 00099 inline 00100 Grid_Generator_System::~Grid_Generator_System() { 00101 } 00102 00103 inline Grid_Generator_System& 00104 Grid_Generator_System::operator=(const Grid_Generator_System& y) { 00105 Generator_System::operator=(y); 00106 return *this; 00107 } 00108 00109 inline dimension_type 00110 Grid_Generator_System::max_space_dimension() { 00111 // Grid generators use an extra column for the parameter divisor. 00112 return Generator_System::max_space_dimension() - 1; 00113 } 00114 00115 inline dimension_type 00116 Grid_Generator_System::space_dimension() const { 00117 assert(Generator_System::space_dimension() > 0); 00118 // Grid generators use an extra column for the parameter divisor. 00119 return Generator_System::space_dimension() - 1; 00120 } 00121 00122 inline const Grid_Generator_System& 00123 Grid_Generator_System::zero_dim_univ() { 00124 assert(zero_dim_univ_p != 0); 00125 return *zero_dim_univ_p; 00126 } 00127 00128 inline void 00129 Grid_Generator_System::clear() { 00130 Generator_System::clear(); 00131 // For grid generators, two extra columns are needed. 00132 add_zero_columns(2); 00133 set_sorted(false); 00134 unset_pending_rows(); 00135 } 00136 00137 inline void 00138 Grid_Generator_System::swap(Grid_Generator_System& y) { 00139 Generator_System::swap(y); 00140 } 00141 00142 inline memory_size_type 00143 Grid_Generator_System::external_memory_in_bytes() const { 00144 return Generator_System::external_memory_in_bytes(); 00145 } 00146 00147 inline memory_size_type 00148 Grid_Generator_System::total_memory_in_bytes() const { 00149 return Generator_System::total_memory_in_bytes(); 00150 } 00151 00152 inline dimension_type 00153 Grid_Generator_System::num_rows() const { 00154 return Generator_System::num_rows(); 00155 } 00156 00157 inline dimension_type 00158 Grid_Generator_System::num_parameters() const { 00159 return Generator_System::num_rays(); 00160 } 00161 00162 inline dimension_type 00163 Grid_Generator_System::num_lines() const { 00164 return Generator_System::num_lines(); 00165 } 00166 00167 inline 00168 Grid_Generator_System::const_iterator::const_iterator() 00169 : Generator_System::const_iterator() { 00170 } 00171 00172 inline 00173 Grid_Generator_System::const_iterator::const_iterator(const const_iterator& y) 00174 : Generator_System::const_iterator(y) { 00175 } 00176 00177 inline 00178 Grid_Generator_System::const_iterator::~const_iterator() { 00179 } 00180 00181 inline 00182 Grid_Generator_System::const_iterator& 00183 Grid_Generator_System::const_iterator::operator=(const const_iterator& y) { 00184 return static_cast<Grid_Generator_System::const_iterator&> 00185 (Generator_System::const_iterator::operator=(y)); 00186 } 00187 00188 inline const Grid_Generator& 00189 Grid_Generator_System::const_iterator::operator*() const { 00190 return static_cast<const Grid_Generator&> 00191 (Generator_System::const_iterator::operator*()); 00192 } 00193 00194 inline const Grid_Generator* 00195 Grid_Generator_System::const_iterator::operator->() const { 00196 return static_cast<const Grid_Generator*> 00197 (Generator_System::const_iterator::operator->()); 00198 } 00199 00200 inline Grid_Generator_System::const_iterator& 00201 Grid_Generator_System::const_iterator::operator++() { 00202 return static_cast<Grid_Generator_System::const_iterator&> 00203 (Generator_System::const_iterator::operator++()); 00204 } 00205 00206 inline Grid_Generator_System::const_iterator 00207 Grid_Generator_System::const_iterator::operator++(int) { 00208 const const_iterator tmp = *this; 00209 operator++(); 00210 return tmp; 00211 } 00212 00213 inline bool 00214 Grid_Generator_System 00215 ::const_iterator::operator==(const const_iterator& y) const { 00216 return Generator_System::const_iterator::operator==(y); 00217 } 00218 00219 inline bool 00220 Grid_Generator_System 00221 ::const_iterator::operator!=(const const_iterator& y) const { 00222 return Generator_System::const_iterator::operator!=(y); 00223 } 00224 00225 inline bool 00226 Grid_Generator_System::empty() const { 00227 return Generator_System::empty(); 00228 } 00229 00230 inline 00231 Grid_Generator_System 00232 ::const_iterator::const_iterator(const Generator_System::const_iterator& y) 00233 : Generator_System::const_iterator::const_iterator(y) { 00234 } 00235 00236 inline Grid_Generator_System::const_iterator 00237 Grid_Generator_System::begin() const { 00238 return static_cast<Grid_Generator_System::const_iterator> 00239 (Generator_System::begin()); 00240 } 00241 00242 inline Grid_Generator_System::const_iterator 00243 Grid_Generator_System::end() const { 00244 return static_cast<Grid_Generator_System::const_iterator> 00245 (Generator_System::end()); 00246 } 00247 00248 inline bool 00249 Grid_Generator_System::has_points() const { 00250 return Generator_System::has_points(); 00251 } 00252 00253 inline Grid_Generator& 00254 Grid_Generator_System::operator[](const dimension_type k) { 00255 return static_cast<Grid_Generator&>(Generator_System::operator[](k)); 00256 } 00257 00258 inline const Grid_Generator& 00259 Grid_Generator_System::operator[](const dimension_type k) const { 00260 return static_cast<const Grid_Generator&>(Generator_System::operator[](k)); 00261 } 00262 00264 inline bool 00265 operator==(const Grid_Generator_System& x, 00266 const Grid_Generator_System& y) { 00267 return x.is_equal_to(y); 00268 } 00269 00270 } // namespace Parma_Polyhedra_Library 00271 00272 00273 namespace std { 00274 00276 inline void 00277 swap(Parma_Polyhedra_Library::Grid_Generator_System& x, 00278 Parma_Polyhedra_Library::Grid_Generator_System& y) { 00279 x.swap(y); 00280 } 00281 00282 } // namespace std 00283 00284 #endif // !defined(PPL_Grid_Generator_System_inlines_hh)