00001 /* Grid_Generator_System class implementation: inline functions. 00002 Copyright (C) 2001-2006 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 2 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 00032 Grid_Generator_System::Grid_Generator_System() 00033 : Generator_System(NECESSARILY_CLOSED) { 00034 adjust_topology_and_space_dimension(NECESSARILY_CLOSED, 1); 00035 set_sorted(false); 00036 } 00037 00038 inline 00039 Grid_Generator_System::Grid_Generator_System(const Grid_Generator_System& gs) 00040 : Generator_System(gs) { 00041 } 00042 00043 inline 00044 Grid_Generator_System::Grid_Generator_System(dimension_type dim) 00045 : Generator_System(NECESSARILY_CLOSED) { 00046 adjust_topology_and_space_dimension(NECESSARILY_CLOSED, dim + 1); 00047 set_sorted(false); 00048 } 00049 00050 inline 00051 Grid_Generator_System::Grid_Generator_System(const Grid_Generator& g) 00052 : Generator_System(g) { 00053 set_sorted(false); 00054 } 00055 00056 inline dimension_type 00057 Grid_Generator_System::max_space_dimension() { 00058 // Grid generators use an extra column for the parameter divisor. 00059 return Generator_System::max_space_dimension() - 1; 00060 } 00061 00062 inline dimension_type 00063 Grid_Generator_System::space_dimension() const { 00064 assert(Generator_System::space_dimension() > 0); 00065 // Grid generators use an extra column for the parameter divisor. 00066 return Generator_System::space_dimension() - 1; 00067 } 00068 00069 inline void 00070 Grid_Generator_System::clear() { 00071 Generator_System::clear(); 00072 // For grid generators, two extra columns are needed. 00073 add_zero_columns(2); 00074 set_sorted(false); 00075 unset_pending_rows(); 00076 } 00077 00078 inline void 00079 Grid_Generator_System::swap(Grid_Generator_System& y) { 00080 Generator_System::swap(y); 00081 } 00082 00083 inline memory_size_type 00084 Grid_Generator_System::external_memory_in_bytes() const { 00085 return Generator_System::external_memory_in_bytes(); 00086 } 00087 00088 inline memory_size_type 00089 Grid_Generator_System::total_memory_in_bytes() const { 00090 return Generator_System::total_memory_in_bytes(); 00091 } 00092 00093 inline dimension_type 00094 Grid_Generator_System::num_generators() const { 00095 return Generator_System::num_rows(); 00096 } 00097 00098 inline dimension_type 00099 Grid_Generator_System::num_parameters() const { 00100 return Generator_System::num_rays(); 00101 } 00102 00103 inline dimension_type 00104 Grid_Generator_System::num_lines() const { 00105 return Generator_System::num_lines(); 00106 } 00107 00108 inline 00109 Grid_Generator_System::const_iterator::const_iterator() 00110 : Generator_System::const_iterator() { 00111 } 00112 00113 inline 00114 Grid_Generator_System::const_iterator::const_iterator(const const_iterator& y) 00115 : Generator_System::const_iterator(y) { 00116 } 00117 00118 inline 00119 Grid_Generator_System::const_iterator::~const_iterator() { 00120 } 00121 00122 inline 00123 Grid_Generator_System::const_iterator& 00124 Grid_Generator_System::const_iterator::operator=(const const_iterator& y) { 00125 return static_cast<Grid_Generator_System::const_iterator&> 00126 (Generator_System::const_iterator::operator=(y)); 00127 } 00128 00129 inline const Grid_Generator& 00130 Grid_Generator_System::const_iterator::operator*() const { 00131 return static_cast<const Grid_Generator&> 00132 (Generator_System::const_iterator::operator*()); 00133 } 00134 00135 inline const Grid_Generator* 00136 Grid_Generator_System::const_iterator::operator->() const { 00137 return static_cast<const Grid_Generator*> 00138 (Generator_System::const_iterator::operator->()); 00139 } 00140 00141 inline Grid_Generator_System::const_iterator& 00142 Grid_Generator_System::const_iterator::operator++() { 00143 return static_cast<Grid_Generator_System::const_iterator&> 00144 (Generator_System::const_iterator::operator++()); 00145 } 00146 00147 inline Grid_Generator_System::const_iterator 00148 Grid_Generator_System::const_iterator::operator++(int) { 00149 const const_iterator tmp = *this; 00150 operator++(); 00151 return tmp; 00152 } 00153 00154 inline bool 00155 Grid_Generator_System 00156 ::const_iterator::operator==(const const_iterator& y) const { 00157 return Generator_System::const_iterator::operator==(y); 00158 } 00159 00160 inline bool 00161 Grid_Generator_System 00162 ::const_iterator::operator!=(const const_iterator& y) const { 00163 return Generator_System::const_iterator::operator!=(y); 00164 } 00165 00166 inline Grid_Generator_System::const_iterator 00167 Grid_Generator_System::begin() const { 00168 return static_cast<Grid_Generator_System::const_iterator> 00169 (Generator_System::begin()); 00170 } 00171 00172 inline Grid_Generator_System::const_iterator 00173 Grid_Generator_System::end() const { 00174 return static_cast<Grid_Generator_System::const_iterator> 00175 (Generator_System::end()); 00176 } 00177 00178 inline 00179 Grid_Generator_System 00180 ::const_iterator::const_iterator(const Generator_System::const_iterator& y) 00181 : Generator_System::const_iterator::const_iterator(y) { 00182 } 00183 00184 inline bool 00185 Grid_Generator_System::has_points() const { 00186 return Generator_System::has_points(); 00187 } 00188 00189 inline Grid_Generator& 00190 Grid_Generator_System::operator[](const dimension_type k) { 00191 return static_cast<Grid_Generator&>(Generator_System::operator[](k)); 00192 } 00193 00194 inline const Grid_Generator& 00195 Grid_Generator_System::operator[](const dimension_type k) const { 00196 return static_cast<const Grid_Generator&>(Generator_System::operator[](k)); 00197 } 00198 00199 inline void 00200 Grid_Generator_System::ascii_dump(std::ostream& s) const { 00201 return Generator_System::ascii_dump(s); 00202 } 00203 00204 inline void 00205 Grid_Generator_System::set_sorted(bool b) { 00206 Generator_System::set_sorted(b); 00207 } 00208 00209 inline void 00210 Grid_Generator_System::unset_pending_rows() { 00211 Generator_System::unset_pending_rows(); 00212 } 00213 00214 inline void 00215 Grid_Generator_System::set_index_first_pending_row(const dimension_type i) { 00216 Generator_System::set_index_first_pending_row(i); 00217 } 00218 00219 inline void 00220 Grid_Generator_System::resize_no_copy(const dimension_type new_n_rows, 00221 const dimension_type new_n_columns) { 00222 Generator_System::resize_no_copy(new_n_rows, new_n_columns); 00223 } 00224 00225 inline dimension_type 00226 Grid_Generator_System::num_columns() const { 00227 return Generator_System::num_columns(); 00228 } 00229 00230 inline void 00231 Grid_Generator_System::erase_to_end(dimension_type first_to_erase) { 00232 return Generator_System::erase_to_end(first_to_erase); 00233 } 00234 00235 inline void 00236 Grid_Generator_System 00237 ::permute_columns(const std::vector<dimension_type>& cycles) { 00238 return Generator_System::permute_columns(cycles); 00239 } 00240 00241 inline bool 00242 Grid_Generator_System::is_equal_to(const Grid_Generator_System y) const { 00243 return operator==(static_cast<const Generator_System&>(*this), 00244 static_cast<const Generator_System&>(y)); 00245 } 00246 00248 inline bool 00249 operator==(const Grid_Generator_System& x, 00250 const Grid_Generator_System& y) { 00251 return x.is_equal_to(y); 00252 } 00253 00254 } // namespace Parma_Polyhedra_Library 00255 00256 00257 namespace std { 00258 00260 inline void 00261 swap(Parma_Polyhedra_Library::Grid_Generator_System& x, 00262 Parma_Polyhedra_Library::Grid_Generator_System& y) { 00263 x.swap(y); 00264 } 00265 00266 } // namespace std 00267 00268 #endif // !defined(PPL_Grid_Generator_System_inlines_hh)