PPL  1.2
Partial_Function_defs.hh
Go to the documentation of this file.
1 /* Partial_Function class declaration.
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_Partial_Function_defs_hh
25 #define PPL_Partial_Function_defs_hh 1
26 
28 #include "globals_defs.hh"
29 #include <vector>
30 #ifndef NDEBUG
31 #include <set>
32 #endif
33 #include <iosfwd>
34 
35 namespace Parma_Polyhedra_Library {
36 
38 public:
44 
49  bool has_empty_codomain() const;
50 
58 
63  bool maps(dimension_type i, dimension_type& j) const;
64 
65  void print(std::ostream& s) const;
66 
74 
75 private:
76  std::vector<dimension_type> vec;
78 #ifndef NDEBUG
79  std::set<dimension_type> codomain;
80 #endif
81 }; // class Partial_Function
82 
83 } // namespace Parma_Polyhedra_Library
84 
86 
87 #endif // !defined(PPL_Partial_Function_defs_hh)
size_t dimension_type
An unsigned integral type for representing space dimensions.
bool has_empty_codomain() const
Returns true if and only if the represented partial function has an empty codomain (i...
Partial_Function()
Default constructor: builds a function with empty codomain (i.e., always undefined).
dimension_type max_in_codomain() const
If the codomain is not empty, returns the maximum value in it.
The entire library is confined to this namespace.
Definition: version.hh:61
bool maps(dimension_type i, dimension_type &j) const
If *this maps i to a value k, assigns k to j and returns true; otherwise, j is unchanged and false is...
void insert(dimension_type i, dimension_type j)
Modifies *this so that i is mapped to j.