UnCoVer (Using Coverability for Verification)
|
This is the data structure representing a morphism mapping from a graph to another graph. More...
#include <Mapping.h>
Public Types | |
typedef unordered_map< IDType, IDType >::iterator | iterator |
An iterator for enumerating all (IDType,IDType)-pairs stores in this Mapping. | |
typedef unordered_map< IDType, IDType >::const_iterator | const_iterator |
A const_iterator for enumerating all (IDType,IDType)-pairs stores in this Mapping. | |
typedef unordered_map< IDType, unordered_set< IDType > > | Inversion |
Alias for an inverse Mapping, mapping IDs to collections of IDs. More... | |
Public Member Functions | |
Mapping () | |
Generates a new empty Mapping object. | |
~Mapping () | |
Destroys this Mapping. | |
bool | delSrc (IDType const &source) |
Removes the mapping for the given ID, if it exists. More... | |
size_t | delSrc (unordered_set< IDType > const &sources) |
Removes all mappings of the given IDs. More... | |
size_t | delTar (IDType const &target) |
Removes all mappings to the target ID. More... | |
size_t | delTar (unordered_set< IDType > const &targets) |
Removes all mappings to one of the target IDs. More... | |
bool | hasSrc (IDType const &source) const |
Returns whether the given ID is mapped to some ID by this Mapping. More... | |
bool | hasTar (IDType const &target) const |
Returns whether some ID is mapped to the given ID by this Mapping. More... | |
IDType const & | getTar (IDType const &source) const |
Returns the ID to which the given ID is mapped. More... | |
void | concat (Mapping const &map) |
Concatenates the given Mapping to the right of this Mapping, effectively changing this Mapping. More... | |
IDType & | operator[] (IDType const &src) |
Returns the ID to which the given ID is mapped. More... | |
unordered_set< IDType > | getInverseMatch (IDType const &tar) const |
Returns the set of all IDs which are mapped to the given ID. More... | |
Mapping::Inversion | getInverseMatch () const |
Returns an Inversion of this Mapping. More... | |
void | getInverseMatch (Mapping::Inversion &invmatch) const |
Clears the given Inversion and stores the Inversion of this Mapping in the given one. More... | |
bool | isInjective () const |
Returns whether this Mapping is injective on all IDs on which it is defined. More... | |
Mapping::iterator | begin () noexcept |
Returns an iterator to the first element of this Mapping. More... | |
Mapping::const_iterator | begin () const noexcept |
Returns a const_iterator to the first element of this Mapping. More... | |
Mapping::const_iterator | cbegin () const noexcept |
Returns a const_iterator to the first element of this Mapping. More... | |
Mapping::iterator | end () noexcept |
Returns an iterator pointing beyond the last element of this Mapping. More... | |
Mapping::const_iterator | end () const noexcept |
Returns a const_iterator pointing beyond the last element of this Mapping. More... | |
Mapping::const_iterator | cend () const noexcept |
Returns a const_iterator pointing beyond the last element of this Mapping. More... | |
void | clear () |
Removes all pairs stores in this Mapping. | |
Private Attributes | |
unordered_map< IDType, IDType > | match |
Stores the data of this Mapping. | |
Friends | |
std::ostream & | operator<< (std::ostream &ost, Mapping const &map) |
Streams a string representation of the given Mapping to the given string. More... | |
bool | operator== (const Mapping &m1, const Mapping &m2) |
Returns true, if and only if the given Mappings are equal (i.e. More... | |
This is the data structure representing a morphism mapping from a graph to another graph.
The morphism property is not (automatically) ensured by this class! It just stores the mapping and provides manipulation methods.
|
noexcept |
|
noexcept |
|
noexcept |
|
noexcept |
void concat | ( | Mapping const & | map | ) |
bool delSrc | ( | IDType const & | source | ) |
Removes the mapping for the given ID, if it exists.
source | the ID of which to mapping should be deleted |
size_t delSrc | ( | unordered_set< IDType > const & | sources | ) |
Removes all mappings of the given IDs.
IDs without mappings are ignored and the number of deleted mappings is returned.
sources | the set of IDs of which to mappings should be deleted |
size_t delTar | ( | IDType const & | target | ) |
Removes all mappings to the target ID.
The number of removed mappings is returned.
target | all mappings to this ID will be deleted |
size_t delTar | ( | unordered_set< IDType > const & | targets | ) |
Removes all mappings to one of the target IDs.
The number of removed mappings is returned.
targets | all mappings to one of this IDs will be deleted |
|
noexcept |
|
noexcept |
Returns the set of all IDs which are mapped to the given ID.
tar | the target ID to which mappings should be found |
Mapping::Inversion getInverseMatch | ( | ) | const |
void getInverseMatch | ( | Mapping::Inversion & | invmatch | ) | const |
Clears the given Inversion and stores the Inversion of this Mapping in the given one.
The Inversion maps all target IDs of this Mapping to the set of all source IDs which are mapped to each target ID. An ID which has no ID mapped to it, has no mapping in the Inversion (obviously).
invmatch | the Inversion which will be set to the Inversion of this Mapping |
Returns the ID to which the given ID is mapped.
source | the ID which should be mapped |
bool hasSrc | ( | IDType const & | source | ) | const |
bool hasTar | ( | IDType const & | target | ) | const |
Returns whether some ID is mapped to the given ID by this Mapping.
target | the ID to be checked |
bool isInjective | ( | ) | const |
Returns the ID to which the given ID is mapped.
If the given ID is not mapped, a new mapping from the given ID to the ID 0 is added and 0 is returned. This operator can also be used to set mappings of this Mapping.
src | the ID of which its image will be returned |
|
friend |