The class implements an Extend-Find data structure which is able to enumerate the components and the items in a component. The data structure is a simplification of the Union-Find structure, and it does not allow to merge two components.
#include <lemon/unionfind.h>
Classes | |
class | ClassIt |
LEMON style iterator for the classes. More... | |
class | ItemIt |
LEMON style iterator for the items of a component. More... | |
Public Types | |
typedef IM | ItemIntMap |
| |
typedef ItemIntMap::Key | Item |
| |
Public Member Functions | |
ExtendFindEnum (ItemIntMap &_index) | |
Constructor. | |
int | insert (const Item &item) |
Inserts the given element into a new component. More... | |
void | insert (const Item &item, int cls) |
Inserts the given element into the given component. More... | |
void | clear () |
Clears the union-find data structure. More... | |
int | find (const Item &item) const |
Gives back the class of the item. More... | |
Item | item (int cls) const |
Gives back a representant item of the component. More... | |
void | erase (const Item &item) |
Removes the given element from the structure. More... | |
void | eraseClass (int cdx) |
Removes the component of the given element from the structure. More... | |
|
inline |
This method creates a new component consisting only of the given element.
|
inline |
This methods inserts the element item a into the cls class.
|
inline |
Erase each item from the data structure.
|
inline |
Gives back the class of the item.
|
inline |
Gives back a representant item of the component.
|
inline |
Removes the element from its component and if the component becomes empty then removes that component from the component list.
|
inline |
Removes the component of the given element from the structure.