#include <vbl_disjoint_sets.h>
Classes | |
| struct | node |
Public Member Functions | |
| vbl_disjoint_sets () | |
| vbl_disjoint_sets (int count) | |
| Create a vbl_disjoint_sets data structure with a specified number of elements (with element id's from 0 to count-1). More... | |
| vbl_disjoint_sets (const vbl_disjoint_sets &s) | |
| Copy constructor. More... | |
| ~vbl_disjoint_sets () | |
| Destructor. More... | |
| int | find_set (int element) const |
| Find the set identifier that an element currently belongs to. More... | |
| void | set_union (int set_id1, int set_id2) |
| Combine two sets into one. More... | |
| void | add_elements (int num_to_add) |
| int | num_elements () const |
| int | size (int set_id) const |
| Returns the number of elements in set specified by set_id. More... | |
| int | num_sets () const |
| Returns the number of sets. More... | |
Private Attributes | |
| int | num_elements_ |
| int | num_sets_ |
| vbl_array_1d< node > | nodes_ |
Definition at line 26 of file vbl_disjoint_sets.h.
| vbl_disjoint_sets::vbl_disjoint_sets | ( | ) |
Definition at line 15 of file vbl_disjoint_sets.cxx.
| vbl_disjoint_sets::vbl_disjoint_sets | ( | int | count | ) |
Create a vbl_disjoint_sets data structure with a specified number of elements (with element id's from 0 to count-1).
Definition at line 21 of file vbl_disjoint_sets.cxx.
| vbl_disjoint_sets::vbl_disjoint_sets | ( | const vbl_disjoint_sets & | s | ) |
Copy constructor.
Definition at line 28 of file vbl_disjoint_sets.cxx.
| vbl_disjoint_sets::~vbl_disjoint_sets | ( | ) |
Destructor.
Definition at line 45 of file vbl_disjoint_sets.cxx.
| void vbl_disjoint_sets::add_elements | ( | int | num_to_add | ) |
Definition at line 111 of file vbl_disjoint_sets.cxx.
| int vbl_disjoint_sets::find_set | ( | int | element | ) | const |
Find the set identifier that an element currently belongs to.
Definition at line 52 of file vbl_disjoint_sets.cxx.
| int vbl_disjoint_sets::num_elements | ( | ) | const |
Definition at line 128 of file vbl_disjoint_sets.cxx.
| int vbl_disjoint_sets::num_sets | ( | ) | const |
Returns the number of sets.
Definition at line 133 of file vbl_disjoint_sets.cxx.
| void vbl_disjoint_sets::set_union | ( | int | set_id1, |
| int | set_id2 | ||
| ) |
Combine two sets into one.
All elements in those two sets will share the same set id that can be retrieved using find_set.
Definition at line 77 of file vbl_disjoint_sets.cxx.
| int vbl_disjoint_sets::size | ( | int | set_id | ) | const |
Returns the number of elements in set specified by set_id.
Definition at line 138 of file vbl_disjoint_sets.cxx.
|
private |
Definition at line 76 of file vbl_disjoint_sets.h.
|
private |
Definition at line 73 of file vbl_disjoint_sets.h.
|
private |
Definition at line 74 of file vbl_disjoint_sets.h.
1.8.15