![]() |
Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
|
Union-Find data structure where the vertices contains a data. More...
#include <Union_find.hpp>
Public Types | |
| typedef T_Union_find_vertex_data_structure_contains< T > | Vertex |
| Representation of a Vertex in the Union-Find data structure. | |
| typedef Base::Independent_set_iterator | Independent_set_iterator |
| Iterator type over the independent set of a Union-Find Vertex. | |
| typedef Base::Leaders_iterator | Leaders_iterator |
| Iterator type over all the leaders of the Union-Find data structure. | |
Accessors | |
| std::size_t | get_number_of_vertices (void) const |
| Number of vertices in the Union-Find data structure. | |
| Vertex * | operator[] (std::size_t i) |
| Access to the ith inserted vertex in the Union-Find data structrure. | |
| const Vertex * | operator[] (std::size_t i) const |
| Const access to the ith inserted vertex in the Union-Find data structrure. | |
| bool | is_empty (void) const |
| Check that there is no Vertex in the Union-Find data structure. | |
| Vertex * | find_vertex (T data) const |
| Return the vertex associated to the given data, or return 0 if not found. | |
| bool | is_leader (const Vertex *v) const |
| Check that v is a leader in the Union-Find data structure. | |
| bool | is_leader (T data) const |
| Check that v is a leader in the Union-Find data structure. | |
| bool | is_singleton (const Vertex *v) const |
| Check that v is in a singleton. | |
| bool | is_singleton (T data) const |
| Check that v is in a singleton. | |
| Vertex * | find_vertex (Vertex *v) const |
| Return the vertex itself. | |
Modifiers | |
| void | reset (void) |
| Separate all the vertices in the Union-Find data structure. | |
| void | clear (void) |
| Remove all the vertices in the Union-Find data structure. | |
Union-Find Operations | |
| Vertex * | make_set (T data) |
| Create a new independent set with one Vertex initialized with the input data. | |
| Vertex * | find_set (Vertex *u) |
| Find the leader of the independent set containing v. | |
| Vertex * | find_set (T data) |
| Find the leader of the independent set containing v. | |
| Vertex * | union_sets (Vertex *u, Vertex *v) |
| Merge the (possibly different) independent sets containing u and v. | |
| Vertex * | union_sets (T data_1, T data_2) |
| Merge the (possibly different) independent sets containing u and v. | |
Leaders | |
| std::size_t | get_number_of_independent_sets (void) const |
| Access to the number of independent sets in the Union-Find data structure. | |
| std::size_t | get_size_of_independent_set (const Vertex *v) const |
| Access to the size of an independent set containing a Union-Find Vertex. | |
| std::size_t | get_size_of_independent_set (T data) const |
| Access to the size of an independent set containing a Union-Find Vertex. | |
| Leaders_iterator | leaders_begin (void) |
| Starts the set of leaders of the Union-Find data structure. | |
| Leaders_iterator | leaders_end (void) |
| Ends the set of leaders of the Union-Find data structure. | |
Independent Set Iterators | |
| Independent_set_iterator | independent_set_begin (Vertex *u) const |
| Starts the independent set of vertices containing v. | |
| Independent_set_iterator | independent_set_begin (T data) const |
| Starts the independent set of vertices containing v. | |
| Independent_set_iterator | independent_set_end (Vertex *u) const |
| Ends the independent set of vertices containing v. | |
| Independent_set_iterator | independent_set_end (T data) const |
| Ends the independent set of vertices containing v. | |
Rewind | |
| void | rewind_to_last_make_set (void) |
| Rewind the Union-Find data structure before the last inserted Vertex. | |
| void | rewind_before_make_set (Vertex *v) |
| Rewind the Union-Find data structure before v was inserted. | |
| void | rewind_before_make_set (T data) |
| Rewind the Union-Find data structure before v was inserted. | |
| void | rewind_to_last_union_sets (void) |
| Rewind the Union-Find data structure before the last union of distinct independent sets. | |
| void | rewind_before_union_sets (Vertex *u, Vertex *v) |
| Rewind the Union-Find data structure before u and v were in the same independent set. | |
| void | rewind_before_union_sets (T data_1, T data_2) |
| Rewind the Union-Find data structure before u and v were in the same independent set. | |
Accessors | |
| bool | is_leader (const Vertex *v) const |
| Check that v is a leader in the Union-Find data structure. | |
| bool | is_singleton (const Vertex *v) const |
| Check that v is in a singleton. | |
Union-Find Operations | |
| Vertex * | make_set (Vertex *v) |
| Create a new independent set with the input Vertex. | |
| Vertex * | const_find_set (Vertex *v) const |
| Const find the leader of the independent set containing v. | |
| Vertex * | find_set (Vertex *v) |
| Find the leader of the independent set containing v. | |
| Vertex * | union_sets (Vertex *u, Vertex *v) |
| Merge the (possibly different) independent sets containing u and v. | |
Algorithms | |
| void | quadratic_union (const UnionComparator &comp=UnionComparator()) |
| Reset the Union-Find data structure and union all the vertices that are in the same independent set related to a given comparator. | |
| void | union_from_edges (InputIterator begin, InputIterator end) |
| Reset the union-Find data structure and union all the vertices that are in the same independent set related to the pairs of vertices in between [begin, end). | |
Leaders | |
| std::size_t | get_size_of_independent_set (const Vertex *v) const |
| Access to the size of an independent set containing a Union-Find Vertex. | |
Independent Set Iterators | |
| Independent_set_iterator | independent_set_begin (Vertex *v) const |
| Starts the independent set of vertices containing v. | |
| Independent_set_iterator | independent_set_end (Vertex *v) const |
| Ends the independent set of vertices containing v. | |
Rewind | |
| void | rewind_before_make_set (Vertex *v) |
| Rewind the Union-Find data structure before v was inserted. | |
| void | rewind_before_union_sets (Vertex *u, Vertex *v) |
| Rewind the Union-Find data structure before u and v were in the same independent set. | |
Union-Find data structure where the vertices contains a data.
The data has to be comparable with the less operator
| typedef Base::Independent_set_iterator Independent_set_iterator |
Iterator type over the independent set of a Union-Find Vertex.
| typedef Base::Leaders_iterator Leaders_iterator |
Iterator type over all the leaders of the Union-Find data structure.
| typedef T_Union_find_vertex_data_structure_contains<T> Vertex |
Representation of a Vertex in the Union-Find data structure.
|
inline |
Remove all the vertices in the Union-Find data structure.
Const find the leader of the independent set containing v.
Contrarily to the non const method, there is no path compression.
Find the leader of the independent set containing v.
|
inline |
Find the leader of the independent set containing v.
|
inline |
Find the leader of the independent set containing v.
|
inline |
Return the vertex associated to the given data, or return 0 if not found.
|
inline |
Access to the number of independent sets in the Union-Find data structure.
|
inline |
Number of vertices in the Union-Find data structure.
|
inlineinherited |
Access to the size of an independent set containing a Union-Find Vertex.
Access to the size of an independent set containing a Union-Find Vertex.
|
inline |
Access to the size of an independent set containing a Union-Find Vertex.
|
inlineinherited |
Starts the independent set of vertices containing v.
|
inline |
Starts the independent set of vertices containing v.
|
inline |
Starts the independent set of vertices containing v.
|
inlineinherited |
Ends the independent set of vertices containing v.
|
inline |
Ends the independent set of vertices containing v.
|
inline |
Ends the independent set of vertices containing v.
|
inline |
Check that there is no Vertex in the Union-Find data structure.
|
inlineinherited |
Check that v is a leader in the Union-Find data structure.
Check that v is a leader in the Union-Find data structure.
|
inline |
Check that v is a leader in the Union-Find data structure.
|
inlineinherited |
Check that v is in a singleton.
Check that v is in a singleton.
|
inline |
Check that v is in a singleton.
|
inline |
Starts the set of leaders of the Union-Find data structure.
|
inline |
Ends the set of leaders of the Union-Find data structure.
|
inline |
|
inline |
Access to the ith inserted vertex in the Union-Find data structrure.
|
inline |
Const access to the ith inserted vertex in the Union-Find data structrure.
|
inlineinherited |
Reset the Union-Find data structure and union all the vertices that are in the same independent set related to a given comparator.
| UnionComparator | Binary functor checking that two vertices are in the same independent set |
|
inline |
Separate all the vertices in the Union-Find data structure.
|
inlineinherited |
Rewind the Union-Find data structure before v was inserted.
It does a rewind_to_last_make_set() until v is removed from the union-Find structure. Note that v is not valid anymore after this operation.
|
inline |
Rewind the Union-Find data structure before v was inserted.
It does a rewind_to_last_make_set() until v is removed from the union-Find structure. Note that v is not valid anymore after this operation.
Rewind the Union-Find data structure before v was inserted.
It does a rewind_to_last_make_set() until v is removed from the union-Find structure. Note that v is not valid anymore after this operation.
Rewind the Union-Find data structure before u and v were in the same independent set.
It does a rewind_to_last_union_sets() until u and v are not in the same independent set.
|
inline |
Rewind the Union-Find data structure before u and v were in the same independent set.
It does a rewind_to_last_union_sets() until u and v are not in the same independent set.
Rewind the Union-Find data structure before u and v were in the same independent set.
It does a rewind_to_last_union_sets() until u and v are not in the same independent set.
|
inline |
Rewind the Union-Find data structure before the last inserted Vertex.
It pops the stack until an insertion is found, and undo all operations encountered.
|
inline |
Rewind the Union-Find data structure before the last union of distinct independent sets.
It pops the stack until an union is found, and undo all operations encountered.
|
inlineinherited |
Reset the union-Find data structure and union all the vertices that are in the same independent set related to the pairs of vertices in between [begin, end).
| InputIterator | Iterator over a set of pairs of vertices. |
Merge the (possibly different) independent sets containing u and v.
|
inline |
Merge the (possibly different) independent sets containing u and v.
|
inline |
Merge the (possibly different) independent sets containing u and v.