|
Classes | |
| struct | GrAL::fail_if_undefined |
| Policy to fail when undefined item is queried. More... | |
| struct | GrAL::identity_if_undefined |
| Policy to return identity when undefined item is queried. More... | |
| class | GrAL::printer_of_bij_mapping< T1, T2, Policy > |
| helper class for custom output of a bijective map More... | |
| class | GrAL::bijective_mapping< T1, T2, Policy > |
| Represents a one-to-one mapping T1 -> T2. More... | |
| class | GrAL::inverse_mapping< T1, T2, Policy > |
| Represents a mapping T2 --> T1 which is the inverse of some bijective_mapping<T1,T2>.
This class has reference semantics with respect to bijective_mapping. More... | |
| class | GrAL::domain_of_bijective_mapping< T1, T2, Policy > |
| Represents the domain of definition of a mapping.
This class allows STL-style iteration over the items of type T1. More... | |
| class | GrAL::range_of_bijective_mapping< T1, T2, Policy > |
Represents the range (image) of a bijective mapping .
This class allows STL-style iteration over the items of type T2. More... | |
Functions | |
| template<class T1 , class T2 , class Policy > | |
| void | GrAL::write_bm (bijective_mapping< T1, T2, Policy > const &m,::std::ostream &out) |
| write a bijective map to ostream | |
| template<class T1 , class T2 , class Policy > | |
| void | GrAL::read_bm (bijective_mapping< T1, T2, Policy > &m,::std::istream &in) |
| read a bijective map from istream | |
| template<class T1 , class T2 , class Policy > | |
| printer_of_bij_mapping< T1, T2, Policy > | GrAL::Printer (bijective_mapping< T1, T2, Policy > const &m) |
| helper function for custom output of a bijective map | |
This module contains class templates for representing bijective mappings:
The extra Policy parameter (which has been omitted for clarity except in the first occurence) permits to control the behaviour of bijective_mapping if evaluated for an item which has not been set explictly. If Policy is fail_if_undefined (the default), than accessing an undefined item is treated as an error. If Policy is identity_if_undefined and T1 == T2 , then the item itself is returned. Thus, simular to partial_mapping, evaluation on an unbounded set of items is possible. However, this policy leads to possibly undetected violations of bijectivity, which would otherwise be detected when the inverse is built. For instance, if we say m[1] = 2 , the mapping m is not bijective any longer because m(1) == 2 || m(2) == 2 , the latter by the implicit identity extension.
Template parameters
(same for bijective_mapping<T1,T2>, inverse_mapping<T1,T2>, domain_of_bijective_mapping<T1,T2>, range_of_bijective_mapping<T1,T2>)
hash<T1> is defined. equal_to<T1> is defined.Description:
Invariants:

Example:
| printer_of_bij_mapping<T1,T2,Policy> GrAL::Printer | ( | bijective_mapping< T1, T2, Policy > const & | m | ) | [inline] |
helper function for custom output of a bijective map
Usage:
bijective_mapping<int,int> bm;
...
cout << Printer(bm) << endl;
Definition at line 174 of file bijective-mapping.h.
1.5.8