PPL
1.2
|
#include <Partial_Function_defs.hh>
Public Member Functions | |
Partial_Function () | |
Default constructor: builds a function with empty codomain (i.e., always undefined). More... | |
bool | has_empty_codomain () const |
Returns true if and only if the represented partial function has an empty codomain (i.e., it is always undefined). More... | |
dimension_type | max_in_codomain () const |
If the codomain is not empty, returns the maximum value in it. More... | |
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 returned. More... | |
void | print (std::ostream &s) const |
void | insert (dimension_type i, dimension_type j) |
Modifies *this so that i is mapped to j . More... | |
Private Attributes | |
std::vector< dimension_type > | vec |
dimension_type | max |
std::set< dimension_type > | codomain |
Definition at line 37 of file Partial_Function_defs.hh.
|
inline |
Default constructor: builds a function with empty codomain (i.e., always undefined).
Definition at line 33 of file Partial_Function_inlines.hh.
|
inline |
Returns true
if and only if the represented partial function has an empty codomain (i.e., it is always undefined).
Definition at line 38 of file Partial_Function_inlines.hh.
Referenced by Parma_Polyhedra_Library::Box< ITV >::map_space_dimensions(), Parma_Polyhedra_Library::Octagonal_Shape< T >::map_space_dimensions(), Parma_Polyhedra_Library::BD_Shape< T >::map_space_dimensions(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), Parma_Polyhedra_Library::Polyhedron::map_space_dimensions(), max_in_codomain(), and print().
|
inline |
Modifies *this
so that i
is mapped to j
.
std::runtime_error | Thrown if *this is already mapping j . |
Definition at line 55 of file Partial_Function_inlines.hh.
References codomain, max, Parma_Polyhedra_Library::not_a_dimension(), and vec.
|
inline |
If *this
maps i
to a value k
, assigns k
to j
and returns true
; otherwise, j
is unchanged and false
is returned.
Definition at line 81 of file Partial_Function_inlines.hh.
References Parma_Polyhedra_Library::not_a_dimension(), and vec.
Referenced by Parma_Polyhedra_Library::Pointset_Ask_Tell< PSET >::map_space_dimensions(), Parma_Polyhedra_Library::Pointset_Powerset< PSET >::map_space_dimensions(), Parma_Polyhedra_Library::Box< ITV >::map_space_dimensions(), Parma_Polyhedra_Library::Octagonal_Shape< T >::map_space_dimensions(), Parma_Polyhedra_Library::BD_Shape< T >::map_space_dimensions(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), and Parma_Polyhedra_Library::Polyhedron::map_space_dimensions().
|
inline |
If the codomain is not empty, returns the maximum value in it.
std::runtime_error | Thrown if called when *this has an empty codomain. |
Definition at line 44 of file Partial_Function_inlines.hh.
References codomain, has_empty_codomain(), and max.
Referenced by Parma_Polyhedra_Library::Box< ITV >::map_space_dimensions(), Parma_Polyhedra_Library::Octagonal_Shape< T >::map_space_dimensions(), Parma_Polyhedra_Library::BD_Shape< T >::map_space_dimensions(), Parma_Polyhedra_Library::Grid::map_space_dimensions(), and Parma_Polyhedra_Library::Polyhedron::map_space_dimensions().
void Parma_Polyhedra_Library::Partial_Function::print | ( | std::ostream & | s | ) | const |
Definition at line 32 of file Partial_Function.cc.
References has_empty_codomain(), Parma_Polyhedra_Library::not_a_dimension(), and vec.
|
private |
Definition at line 79 of file Partial_Function_defs.hh.
Referenced by has_empty_codomain(), insert(), and max_in_codomain().
|
private |
Definition at line 77 of file Partial_Function_defs.hh.
Referenced by insert(), and max_in_codomain().
|
private |
Definition at line 76 of file Partial_Function_defs.hh.
Referenced by has_empty_codomain(), insert(), maps(), and print().