PPL  1.2
Affine_Space_inlines.hh
Go to the documentation of this file.
1 /* Affine_Space 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_Affine_Space_inlines_hh
25 #define PPL_Affine_Space_inlines_hh 1
26 
27 namespace Parma_Polyhedra_Library {
28 
29 inline dimension_type
32 }
33 
34 inline
36  const Degenerate_Element kind)
37  : gr(num_dimensions, kind) {
38 }
39 
40 inline
42  Complexity_Class complexity)
43  : gr(y.gr, complexity) {
44 }
45 
46 inline
48  : gr(cs) {
49 }
50 
51 inline
53  : gr(cs, ri) {
54 }
55 
56 inline
58  Complexity_Class complexity)
59  : gr(ph, complexity) {
60 }
61 
62 inline
64  : gr(EMPTY) {
65  Affine_Space(gs).m_swap(*this);
66 }
67 
68 template <typename U>
69 inline
71  Complexity_Class complexity)
72  : gr(bd, complexity) {
73 }
74 
75 template <typename U>
76 inline
78  Complexity_Class complexity)
79  : gr(os, complexity) {
80 }
81 
82 inline
84 }
85 
86 inline dimension_type
88  return gr.space_dimension();
89 }
90 
91 inline memory_size_type
93  return gr.total_memory_in_bytes();
94 }
95 
96 inline int32_t
98  return gr.hash_code();
99 }
100 
101 inline Constraint_System
103  return gr.constraints();
104 }
105 
106 inline Constraint_System
108  return gr.minimized_constraints();
109 }
110 
111 inline void
113  swap(gr, y.gr);
114 }
115 
116 inline void
118  gr.add_congruence(cg);
119 }
120 
121 inline void
123  gr.add_congruences(cgs);
124 }
125 
126 inline void
129 }
130 
131 inline void
134 }
135 
136 inline bool
139 }
140 
141 inline bool
144 }
145 
146 inline void
148  gr.add_constraint(c);
149 }
150 
151 inline void
154 }
155 
156 inline bool
158  return gr.bounds_from_above(expr);
159 }
160 
161 inline bool
163  return gr.bounds_from_below(expr);
164 }
165 
166 inline bool
168  Coefficient& sup_n, Coefficient& sup_d,
169  bool& maximum) const {
170  return gr.maximize(expr, sup_n, sup_d, maximum);
171 }
172 
173 inline bool
175  Coefficient& sup_n, Coefficient& sup_d,
176  bool& maximum, Generator& point) const {
177  return gr.maximize(expr, sup_n, sup_d, maximum, point);
178 }
179 
180 inline bool
182  Coefficient& inf_n, Coefficient& inf_d,
183  bool& minimum) const {
184  return gr.minimize(expr, inf_n, inf_d, minimum);
185 }
186 
187 inline bool
189  Coefficient& inf_n, Coefficient& inf_d,
190  bool& minimum, Generator& point) const {
191  return gr.minimize(expr, inf_n, inf_d, minimum, point);
192 }
193 
194 inline bool
196  Coefficient& freq_n, Coefficient& freq_d,
197  Coefficient& val_n, Coefficient& val_d) const {
198  return gr.frequency(expr, freq_n, freq_d, val_n, val_d);
199 }
200 
202 inline bool
203 operator!=(const Affine_Space& x, const Affine_Space& y) {
204  return !(x == y);
205 }
206 
207 inline bool
209  return gr.strictly_contains(y.gr);
210 }
211 
212 inline void
214 }
215 
217 inline void
219  x.m_swap(y);
220 }
221 
222 } // namespace Parma_Polyhedra_Library
223 
224 #endif // !defined(PPL_Affine_Space_inlines_hh)
The empty element, i.e., the empty set.
A linear equality or inequality.
void add_constraint(const Constraint &c)
Adds to *this a congruence equivalent to constraint c.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
size_t dimension_type
An unsigned integral type for representing space dimensions.
void refine_with_congruences(const Congruence_System &cgs)
Uses a copy of the congruences in cgs to refine *this.
A line, ray, point or closure point.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
Constraint_System minimized_constraints() const
Returns a minimal system of equality constraints satisfied by *this with the same affine dimension as...
bool bounds_from_above(const Linear_Expression &expr) const
Returns true if and only if expr is bounded in *this.
static bool can_recycle_constraint_systems()
Returns true indicating that this domain has methods that can recycle constraints.
int32_t hash_code() const
Returns a 32-bit hash code for *this.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
static bool can_recycle_congruence_systems()
Returns true indicating that this domain has methods that can recycle congruences.
void add_congruences(const Congruence_System &cgs)
Adds a copy of each congruence in cgs to *this.
bool strictly_contains(const Grid &y) const
Returns true if and only if *this strictly contains y.
void refine_with_congruence(const Congruence &cg)
Uses a copy of the congruence cg to refine *this.
Complexity_Class
Complexity pseudo-classes.
The base class for convex polyhedra.
bool strictly_contains(const Affine_Space &y) const
Returns true if and only if *this strictly contains y.
bool bounds_from_below(const Linear_Expression &expr) const
Returns true if and only if expr is bounded in *this.
bool operator!=(const Affine_Space &x, const Affine_Space &y)
Degenerate_Element
Kinds of degenerate abstract elements.
bool maximize(const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum) const
Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value is computed.
static bool can_recycle_congruence_systems()
Returns true indicating that this domain has methods that can recycle congruences.
Grid gr
The rational grid implementing *this.
void refine_with_congruences(const Congruence_System &cgs)
Uses a copy of the congruences in cgs to refine *this.
void topological_closure_assign()
Assigns to *this its topological closure.
bool bounds_from_above(const Linear_Expression &expr) const
Returns true if and only if expr is bounded in *this.
PPL_COEFFICIENT_TYPE Coefficient
An alias for easily naming the type of PPL coefficients.
bool minimize(const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum) const
Returns true if and only if *this is not empty and expr is bounded from below in *this, in which case the infimum value is computed.
void refine_with_congruence(const Congruence &cg)
Uses a copy of the congruence cg to refine *this.
int32_t hash_code() const
Returns a 32-bit hash code for *this.
Affine_Space(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds an affine space having the specified properties.
dimension_type space_dimension() const
Returns the dimension of the vector space enclosing *this.
void m_swap(Affine_Space &y)
Swaps *this with affine space y. (*this and y can be dimension-incompatible.)
bool frequency(const Linear_Expression &expr, Coefficient &freq_n, Coefficient &freq_d, Coefficient &val_n, Coefficient &val_d) const
Returns true if and only if *this is not empty and expr is discrete in *this, in which case the maxim...
Constraint_System constraints() const
Returns a system of equality constraints satisfied by *this with the same affine dimension as *this...
The entire library is confined to this namespace.
Definition: version.hh:61
static dimension_type max_space_dimension()
Returns the maximum space dimension all kinds of Affine_Space can handle.
A bounded difference shape.
void add_congruence(const Congruence &cg)
Adds a copy of congruence cg to *this.
Constraint_System minimized_constraints() const
Returns a minimal system of equality constraints satisfied by *this with the same affine dimension as...
void swap(Affine_Space &x, Affine_Space &y)
Swaps x with y.
bool frequency(const Linear_Expression &expr, Coefficient &freq_n, Coefficient &freq_d, Coefficient &val_n, Coefficient &val_d) const
Returns true if and only if *this is not empty and frequency for *this with respect to expr is define...
void add_constraint(const Constraint &c)
Adds to *this a congruence equivalent to constraint c.
bool maximize(const Linear_Expression &expr, Coefficient &sup_n, Coefficient &sup_d, bool &maximum) const
Returns true if and only if *this is not empty and expr is bounded from above in *this, in which case the supremum value is computed.
void add_recycled_constraints(Constraint_System &cs)
Adds to *this congruences equivalent to the constraints in cs.
static dimension_type max_space_dimension()
Returns the maximum space dimension all kinds of Grid can handle.
bool bounds_from_below(const Linear_Expression &expr) const
Returns true if and only if expr is bounded in *this.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
Coefficient c
Definition: PIP_Tree.cc:64
void add_congruence(const Congruence &cg)
Adds a copy of congruence cg to *this.
bool minimize(const Linear_Expression &expr, Coefficient &inf_n, Coefficient &inf_d, bool &minimum) const
Returns true if and only if *this is not empty and expr is bounded from below in *this, in which case the infimum value is computed.
void add_congruences(const Congruence_System &cgs)
Adds a copy of each congruence in cgs to *this.
Constraint_System constraints() const
Returns a system of equality constraints satisfied by *this with the same affine dimension as *this...
void add_recycled_constraints(Constraint_System &cs)
Adds to *this congruences equivalent to the constraints in cs.
static bool can_recycle_constraint_systems()
Returns true indicating that this domain has methods that can recycle constraints.