|
Polymake Template Library (PTL)
3.6
|
An equivalence relation on the integers 0,..,n-1 for a given size n.
More...

Public Member Functions | |
| EquivalenceRelation () | |
| Creates the trivial equivalence relation on the empty set. | |
| EquivalenceRelation (const int size) | |
| template<typename Container > | |
| EquivalenceRelation (const int size, const Container &represent) | |
| int | representative (int e) const |
| Return the representative of the equivalence class containing e. | |
| const Array< int > & | representatives () const |
| Return the representatives of the equivalence classes of all elements. | |
| void | merge_classes (const int c1, const int c2) |
| Merges two equivalence classes each represented by one (arbitrary) of its elements. | |
| template<typename Container > | |
| void | merge_classes (const Container &classes) |
| Merges the classes of all the elements contained in classes. | |
| const Set< int > & | set_of_rep () const |
| Return the set of all representatives. | |
| Set< int > | equivalence_class (const int e) const |
| Return the equivalence class of the element e. | |
| PowerSet< int > | equivalence_classes () const |
| Return all equivalence classes. | |
| bool | related (const int e1, const int e2) const |
| Return true iff e1 and e2 are in the same equivalence class. | |
| void | set_representative (const int e) |
| The element e will be used as user defined representative of it's equivalence class. | |
An equivalence relation on the integers 0,..,n-1 for a given size n.
Initially, each element is contained in an equivalence class by itself. Two equivalence classes can be merged by specifying one (arbitrary) representative of each class. Alternatively, a set of representatives may be specified and the corresponding equivalence classes will be merged.
Each equivalence class is represented by its smallest element (default) or alternatively by a user defined element. If classes with user defined representatives are merged, the smallest of the user defined representatives is chosen to represent the new equivalence class.
|
inlineexplicit |
Creates the equivalence relation on the integers 0,..,size-1 where each element is contained in an equivalence class by itself.
|
inline |
Creates the equivalence relation on the integers 0,..,size-1 where each element is contained in an equivalence class by itself. The representatives will be used as user defined representatives.
1.8.15