PPL  1.2
C_Polyhedron_inlines.hh
Go to the documentation of this file.
1 /* C_Polyhedron 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_C_Polyhedron_inlines_hh
25 #define PPL_C_Polyhedron_inlines_hh 1
26 
27 #include <algorithm>
28 #include <stdexcept>
29 
30 namespace Parma_Polyhedra_Library {
31 
32 inline
34 }
35 
36 inline
38  Degenerate_Element kind)
40  check_space_dimension_overflow(num_dimensions,
42  "C_Polyhedron(n, k)",
43  "n exceeds the maximum "
44  "allowed space dimension"),
45  kind) {
46 }
47 
48 inline
51  check_obj_space_dimension_overflow(cs, NECESSARILY_CLOSED,
52  "C_Polyhedron(cs)",
53  "the space dimension of cs "
54  "exceeds the maximum allowed "
55  "space dimension")) {
56 }
57 
58 inline
61  check_obj_space_dimension_overflow(cs, NECESSARILY_CLOSED,
62  "C_Polyhedron(cs, recycle)",
63  "the space dimension of cs "
64  "exceeds the maximum allowed "
65  "space dimension"),
66  Recycle_Input()) {
67 }
68 
69 inline
72  check_obj_space_dimension_overflow(gs, NECESSARILY_CLOSED,
73  "C_Polyhedron(gs)",
74  "the space dimension of gs "
75  "exceeds the maximum allowed "
76  "space dimension")) {
77 }
78 
79 inline
82  check_obj_space_dimension_overflow(gs, NECESSARILY_CLOSED,
83  "C_Polyhedron(gs, recycle)",
84  "the space dimension of gs "
85  "exceeds the maximum allowed "
86  "space dimension"),
87  Recycle_Input()) {
88 }
89 
90 template <typename Interval>
91 inline
94  check_obj_space_dimension_overflow(box, NECESSARILY_CLOSED,
95  "C_Polyhedron(box)",
96  "the space dimension of box "
97  "exceeds the maximum allowed "
98  "space dimension")) {
99 }
100 
101 template <typename U>
102 inline
105  check_space_dimension_overflow(bd.space_dimension(),
107  "C_Polyhedron(bd)",
108  "the space dimension of bd "
109  "exceeds the maximum allowed "
110  "space dimension"),
111  UNIVERSE) {
113 }
114 
115 template <typename U>
116 inline
119  check_space_dimension_overflow(os.space_dimension(),
121  "C_Polyhedron(os)",
122  "the space dimension of os "
123  "exceeds the maximum allowed "
124  "space dimension"),
125  UNIVERSE) {
127 }
128 
129 inline
131  : Polyhedron(y) {
132 }
133 
134 inline C_Polyhedron&
137  return *this;
138 }
139 
140 inline C_Polyhedron&
142  C_Polyhedron c_y(y);
143  m_swap(c_y);
144  return *this;
145 }
146 
147 inline bool
149  return poly_hull_assign_if_exact(y);
150 }
151 
152 } // namespace Parma_Polyhedra_Library
153 
154 #endif // !defined(PPL_C_Polyhedron_inlines_hh)
size_t dimension_type
An unsigned integral type for representing space dimensions.
C_Polyhedron(dimension_type num_dimensions=0, Degenerate_Element kind=UNIVERSE)
Builds either the universe or the empty C polyhedron.
Polyhedron & operator=(const Polyhedron &y)
The assignment operator. (*this and y can be dimension-incompatible.)
Constraint_System constraints() const
Returns the system of constraints defining *this.
C_Polyhedron & operator=(const C_Polyhedron &y)
The assignment operator. (*this and y can be dimension-incompatible.)
Complexity_Class
Complexity pseudo-classes.
The base class for convex polyhedra.
Degenerate_Element
Kinds of degenerate abstract elements.
dimension_type check_space_dimension_overflow(const dimension_type dim, const dimension_type max, const char *domain, const char *method, const char *reason)
Definition: globals.cc:48
A not necessarily closed convex polyhedron.
Constraint_System constraints() const
Returns a system of constraints defining *this.
A not necessarily closed, iso-oriented hyperrectangle.
Definition: Box_defs.hh:299
A closed convex polyhedron.
bool upper_bound_assign_if_exact(const C_Polyhedron &y)
Same as poly_hull_assign_if_exact(y).
The universe element, i.e., the whole vector space.
void add_constraints(const Constraint_System &cs)
Adds a copy of the constraints in cs to the system of constraints of *this (without minimizing the re...
The entire library is confined to this namespace.
Definition: version.hh:61
A bounded difference shape.
bool poly_hull_assign_if_exact(const C_Polyhedron &y)
If the poly-hull of *this and y is exact it is assigned to *this and true is returned, otherwise false is returned.
Definition: C_Polyhedron.cc:86
void m_swap(Polyhedron &y)
Swaps *this with polyhedron y. (*this and y can be dimension-incompatible.)