ExtendFindEnum Class Template Reference
[Auxiliary Data Structures]

#include <lemon/unionfind.h>

List of all members.


Detailed Description

template<typename _ItemIntMap>
class lemon::ExtendFindEnum< _ItemIntMap >

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.

Precondition:
You need to add all the elements by the insert() method.

Public Member Functions

 ExtendFindEnum (ItemIntMap &_index)
 Constructor.
int insert (const Item &item)
 Inserts the given element into a new component.
void insert (const Item &item, int cls)
 Inserts the given element into the given component.
void clear ()
 Clears the union-find data structure.
int find (const Item &item) const
 Gives back the class of the item.
Item item (int cls) const
 Gives back a representant item of the component.
void erase (const Item &item)
 Removes the given element from the structure.
void eraseClass (int cdx)
 Removes the component of the given element from the structure.

Classes

class  ClassIt
 LEMON style iterator for the classes. More...
class  ItemIt
 LEMON style iterator for the items of a component. More...

Member Function Documentation

int insert ( const Item &  item  )  [inline]

This method creates a new component consisting only of the given element.

void insert ( const Item &  item,
int  cls 
) [inline]

This methods inserts the element item a into the cls class.

void clear (  )  [inline]

Erase each item from the data structure.

int find ( const Item &  item  )  const [inline]

Gives back the class of the item.

Item item ( int  cls  )  const [inline]

Gives back a representant item of the component.

void erase ( const Item &  item  )  [inline]

Removes the element from its component and if the component becomes empty then removes that component from the component list.

Warning:
It is an error to remove an element which is not in the structure.

void eraseClass ( int  cdx  )  [inline]

Removes the component of the given element from the structure.

Warning:
It is an error to give an element which is not in the structure.


The documentation for this class was generated from the following file:

Generated on Fri Jan 23 18:15:19 2009 for LEMON by  doxygen 1.5.6