cgv
cgv::math::union_find Struct Reference

#include <union_find.h>

Public Member Functions

 union_find (int N)
 N number of all elements.
 
 ~union_find ()
 destructor
 
int num_of_components ()
 number of sets (initially number of all elements)
 
int find (int x)
 return label number of element x
 
void unite (int p, int q)
 unite the set containing p with the set containing q (if p and q are in the same set, nothing is done)
 
bool find (int p, int q)
 check wether p and q are in the same set
 

Detailed Description

A union find data structure


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