Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Static Public Member Functions | List of all members
limbo::containers::DisjointSet Class Reference

simply used for scope control More...

#include <DisjointSet.h>

Classes

struct  SubsetHelper
 a sample implementation of SubsetHelper that uses std::vector as the container. It needs to store parent elements and ranks. More...
 

Static Public Member Functions

template<typename SubsetHelperType >
static
SubsetHelperType::element_type
const & 
find_set (SubsetHelperType const &gp, typename SubsetHelperType::element_type const &e)
 find the subset of an element e More...
 
template<typename SubsetHelperType >
static void union_set (SubsetHelperType &gp, typename SubsetHelperType::element_type const &e1, typename SubsetHelperType::element_type const &e2)
 union two subsets represented by element e1 and e2 More...
 
template<typename SubsetHelperType >
static std::size_t count_sets (SubsetHelperType const &gp)
 

Detailed Description

simply used for scope control

Definition at line 28 of file DisjointSet.h.

Member Function Documentation

template<typename SubsetHelperType >
static std::size_t limbo::containers::DisjointSet::count_sets ( SubsetHelperType const &  gp)
inlinestatic

count the number of subsets

Template Parameters
SubsetHelperTypesubset helper that wraps elements and ranks
Parameters
gpa function object to get and set parent of an element

Definition at line 69 of file DisjointSet.h.

template<typename SubsetHelperType >
static SubsetHelperType::element_type const& limbo::containers::DisjointSet::find_set ( SubsetHelperType const &  gp,
typename SubsetHelperType::element_type const &  e 
)
inlinestatic

find the subset of an element e

Template Parameters
SubsetHelperTypesubset helper that wraps elements and ranks
Parameters
gpa function object to get parent of an element
ecurrent element
Returns
subset of element e

Definition at line 36 of file DisjointSet.h.

template<typename SubsetHelperType >
static void limbo::containers::DisjointSet::union_set ( SubsetHelperType &  gp,
typename SubsetHelperType::element_type const &  e1,
typename SubsetHelperType::element_type const &  e2 
)
inlinestatic

union two subsets represented by element e1 and e2

Template Parameters
SubsetHelperTypesubset helper that wraps elements and ranks
Parameters
gpa mutable function object to get and set parent of an element
e1first element
e2second element, after union_set() operation, e2 will become e1's parent

Definition at line 49 of file DisjointSet.h.


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