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