PPL  1.2
Grid_Generator_System_inlines.hh
Go to the documentation of this file.
1 /* Grid_Generator_System class implementation: inline functions.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Grid_Generator_System_inlines_hh
25 #define PPL_Grid_Generator_System_inlines_hh 1
26 
27 #include "Grid_Generator_defs.hh"
28 
29 namespace Parma_Polyhedra_Library {
30 
31 inline void
33  sys.set_sorted(b);
34 }
35 
36 inline void
38  sys.unset_pending_rows();
39 }
40 
41 inline void
43  sys.set_index_first_pending_row(i);
44 }
45 
46 inline void
48 ::permute_space_dimensions(const std::vector<Variable>& cycle) {
49  return sys.permute_space_dimensions(cycle);
50 }
51 
52 inline bool
54  return (sys == y.sys);
55 }
56 
57 inline
59  : sys(NECESSARILY_CLOSED, r) {
60  sys.set_sorted(false);
61  PPL_ASSERT(space_dimension() == 0);
62 }
63 
64 inline
66  : sys(gs.sys) {
67 }
68 
69 inline
72  : sys(gs.sys, r) {
73 }
74 
75 inline
78  : sys(NECESSARILY_CLOSED, r) {
79  sys.set_space_dimension(dim);
80  sys.set_sorted(false);
81  PPL_ASSERT(space_dimension() == dim);
82 }
83 
84 inline
87  : sys(NECESSARILY_CLOSED, r) {
88  sys.insert(g);
89  sys.set_sorted(false);
90 }
91 
92 inline
94 }
95 
98  Grid_Generator_System tmp = y;
99  swap(*this, tmp);
100  return *this;
101 }
102 
103 inline Representation
105  return sys.representation();
106 }
107 
108 inline void
110  sys.set_representation(r);
111 }
112 
113 inline dimension_type
115  // Grid generators use an extra column for the parameter divisor.
117 }
118 
119 inline dimension_type
121  return sys.space_dimension();
122 }
123 
124 inline const Grid_Generator_System&
126  PPL_ASSERT(zero_dim_univ_p != 0);
127  return *zero_dim_univ_p;
128 }
129 
130 inline void
132  sys.clear();
133  sys.set_sorted(false);
134  sys.unset_pending_rows();
135  PPL_ASSERT(space_dimension() == 0);
136 }
137 
138 inline void
140  swap(sys, y.sys);
141 }
142 
143 inline memory_size_type
145  return sys.external_memory_in_bytes();
146 }
147 
148 inline memory_size_type
150  return external_memory_in_bytes() + sizeof(*this);
151 }
152 
153 inline dimension_type
155  return sys.num_rows();
156 }
157 
158 inline
160  : i() {
161 }
162 
163 inline
165  : i(y.i) {
166 }
167 
168 inline
170 }
171 
174  i = y.i;
175  return *this;
176 }
177 
178 inline const Grid_Generator&
180  return *i;
181 }
182 
183 inline const Grid_Generator*
185  return i.operator->();
186 }
187 
190  ++i;
191  return *this;
192 }
193 
196  const const_iterator tmp = *this;
197  operator++();
198  return tmp;
199 }
200 
201 inline bool
204  return i == y.i;
205 }
206 
207 inline bool
210  return i != y.i;
211 }
212 
213 inline bool
215  return sys.has_no_rows();
216 }
217 
218 inline
221  : i(y) {
222 }
223 
226  return static_cast<Grid_Generator_System::const_iterator>(sys.begin());
227 }
228 
231  return static_cast<Grid_Generator_System::const_iterator>(sys.end());
232 }
233 
234 inline const Grid_Generator&
236  return sys[k];
237 }
238 
239 inline bool
241  return sys.has_no_rows();
242 }
243 
244 inline void
246  sys.remove_trailing_rows(n);
247 }
248 
249 inline void
251  sys.insert(g);
252 }
253 
254 inline Topology
256  return sys.topology();
257 }
258 
259 inline dimension_type
261  return sys.first_pending_row();
262 }
263 
265 inline bool
267  const Grid_Generator_System& y) {
268  return x.is_equal_to(y);
269 }
270 
272 inline void
274  x.m_swap(y);
275 }
276 
277 } // namespace Parma_Polyhedra_Library
278 
279 #endif // !defined(PPL_Grid_Generator_System_inlines_hh)
static const Grid_Generator_System * zero_dim_univ_p
Holds (between class initialization and finalization) a pointer to the singleton system containing on...
bool operator==(const Grid_Generator_System &x, const Grid_Generator_System &y)
Representation representation() const
Returns the current representation of *this.
bool operator==(const const_iterator &y) const
Returns true if and only if *this and y are identical.
size_t dimension_type
An unsigned integral type for representing space dimensions.
bool empty() const
Returns true if and only if *this has no generators.
void permute_space_dimensions(const std::vector< Variable > &cycle)
Permutes the space dimensions of the matrix.
const_iterator end() const
Returns the past-the-end const_iterator.
bool operator!=(const const_iterator &y) const
Returns true if and only if *this and y are different.
bool is_equal_to(const Grid_Generator_System &y) const
Returns true if *this is identical to y.
void clear()
Removes all the generators from the generator system and sets its space dimension to 0...
const_iterator begin() const
Returns the const_iterator pointing to the first generator, if this is not empty; otherwise...
const Grid_Generator & operator*() const
Dereference operator.
void set_representation(Representation r)
Converts *this to the specified representation.
void m_swap(Grid_Generator_System &y)
Swaps *this with y.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Grid_Generator_System can handle.
const_iterator & operator=(const const_iterator &y)
Assignment operator.
memory_size_type external_memory_in_bytes() const
Returns the size in bytes of the memory managed by *this.
dimension_type first_pending_row() const
Returns the index of the first pending row.
const Grid_Generator & operator[](dimension_type k) const
Returns a constant reference to the k- th generator of the system.
const Grid_Generator * operator->() const
Indirect member selector.
Swapping_Vector< Row >::const_iterator const_iterator
void set_sorted(bool b)
Sets the sortedness flag of the system to b.
Topology topology() const
Returns the system topology.
void swap(Grid_Generator_System &x, Grid_Generator_System &y)
Swaps x with y.
void unset_pending_rows()
Sets the index to indicate that the system has no pending rows.
The entire library is confined to this namespace.
Definition: version.hh:61
dimension_type num_rows() const
Returns the number of rows (generators) in the system.
static const Grid_Generator_System & zero_dim_univ()
Returns the singleton system containing only Grid_Generator::zero_dim_point().
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
static dimension_type max_space_dimension()
Returns the maximum space dimension a Linear_System can handle.
void set_index_first_pending_row(dimension_type i)
Sets the index of the first pending row to i.
Grid_Generator_System(Representation r=default_representation)
Default constructor: builds an empty system of generators.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
void remove_trailing_rows(dimension_type n)
Makes the system shrink by removing its n trailing rows.
A grid line, parameter or grid point.
Topology
Kinds of polyhedra domains.
Grid_Generator_System & operator=(const Grid_Generator_System &y)
Assignment operator.