Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

unionfind Class Template Reference

Union-find data structure. More...

#include <unionfind.h>

Collaboration diagram for unionfind:

Collaboration graph
[legend]
List of all members.

Public Methods

 unionfind (unsigned int s)
 Construct a new union find structure of a given size.

 ~unionfind ()
 Destructor.

find (T a)
 Finds the equivilence class of a.

void join (T a, T b)
 Join the equivilence classes of a and b.


Protected Methods

void link (T a, T b)
 Internal link of two equivilence classes.


Protected Attributes

unsigned int size
 Size of the union find structure.

T * array
 Mapping of values to equivilence class.


Detailed Description

template<typename T>
class unionfind< T >

Union-find data structure.

Todo:
Collapse trees in 'find'.


The documentation for this class was generated from the following file:
This documentation was generated using doxygen. If you have any comments or additions please mail me.