Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType > Struct Template Reference

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

#include <DisjointSet.h>

Public Types

typedef ElementType element_type
 
typedef RankType rank_type
 

Public Member Functions

 SubsetHelper (std::vector< element_type > &vp, std::vector< rank_type > &vr)
 constructor More...
 
element_type const & get_parent (element_type const &e) const
 get parent element More...
 
void set_parent (element_type const &e, element_type const &p)
 set parent element More...
 
rank_type const & get_rank (element_type const &e) const
 get rank More...
 
void set_rank (element_type const &e, rank_type const &r)
 set rank More...
 
std::size_t size () const
 

Public Attributes

std::vector< element_type > & vParent
 reference to parent array
 
std::vector< rank_type > & vRank
 reference to rank array
 

Detailed Description

template<typename ElementType, typename RankType>
struct limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType >

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

Template Parameters
ElementTypeelement type
RankTyperank type

Definition at line 83 of file DisjointSet.h.

Constructor & Destructor Documentation

template<typename ElementType , typename RankType >
limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType >::SubsetHelper ( std::vector< element_type > &  vp,
std::vector< rank_type > &  vr 
)
inline

constructor

Parameters
vparray of parants
vrarray of ranks

Definition at line 96 of file DisjointSet.h.

Member Function Documentation

template<typename ElementType , typename RankType >
element_type const& limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType >::get_parent ( element_type const &  e) const
inline

get parent element

Parameters
eelement
Returns
parent element

Definition at line 108 of file DisjointSet.h.

template<typename ElementType , typename RankType >
rank_type const& limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType >::get_rank ( element_type const &  e) const
inline

get rank

Parameters
eelement
Returns
rank

Definition at line 116 of file DisjointSet.h.

template<typename ElementType , typename RankType >
void limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType >::set_parent ( element_type const &  e,
element_type const &  p 
)
inline

set parent element

Parameters
eelement
pparent element

Definition at line 112 of file DisjointSet.h.

template<typename ElementType , typename RankType >
void limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType >::set_rank ( element_type const &  e,
rank_type const &  r 
)
inline

set rank

Parameters
eelement
rrank

Definition at line 120 of file DisjointSet.h.

template<typename ElementType , typename RankType >
std::size_t limbo::containers::DisjointSet::SubsetHelper< ElementType, RankType >::size ( ) const
inline
Returns
number of elements

Definition at line 122 of file DisjointSet.h.


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