Jlm
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
jlm::util::DisjointSet< T > Class Template Referencefinal

#include <disjointset.hpp>

Classes

class  MemberIterator
 
class  Set
 
class  SetIterator
 

Public Member Functions

constexpr DisjointSet ()=default
 
 DisjointSet (const std::vector< T > &elements)
 
 DisjointSet (const DisjointSet &other)
 
 DisjointSet (DisjointSet &&other)
 
DisjointSetoperator= (const DisjointSet &other)
 
DisjointSetoperator= (DisjointSet &&other)
 
void insert (const std::vector< T > &elements)
 
const Setinsert (const T &element)
 
SetIterator begin () const
 
SetIterator end () const
 
bool empty () const noexcept
 
size_t nvalues () const noexcept
 
size_t nsets () const noexcept
 
void clear ()
 
const Setfind (const T &element) const noexcept
 
const Setfind_or_insert (const T &element) noexcept
 
const Setmerge (const T &e1, const T &e2)
 

Private Member Functions

bool contains (const T &element) const
 

Private Attributes

std::unordered_set< const Set * > roots_
 
std::unordered_map< T, std::unique_ptr< Set > > values_
 

Detailed Description

template<class T>
class jlm::util::DisjointSet< T >

Definition at line 20 of file disjointset.hpp.

Constructor & Destructor Documentation

◆ DisjointSet() [1/4]

template<class T >
constexpr jlm::util::DisjointSet< T >::DisjointSet ( )
constexprdefault

◆ DisjointSet() [2/4]

template<class T >
jlm::util::DisjointSet< T >::DisjointSet ( const std::vector< T > &  elements)
inlineexplicit

Definition at line 249 of file disjointset.hpp.

◆ DisjointSet() [3/4]

template<class T >
jlm::util::DisjointSet< T >::DisjointSet ( const DisjointSet< T > &  other)
inline

Definition at line 254 of file disjointset.hpp.

◆ DisjointSet() [4/4]

template<class T >
jlm::util::DisjointSet< T >::DisjointSet ( DisjointSet< T > &&  other)
inline

Definition at line 259 of file disjointset.hpp.

Member Function Documentation

◆ begin()

template<class T >
SetIterator jlm::util::DisjointSet< T >::begin ( ) const
inline

Definition at line 308 of file disjointset.hpp.

◆ clear()

template<class T >
void jlm::util::DisjointSet< T >::clear ( )
inline

Definition at line 338 of file disjointset.hpp.

◆ contains()

template<class T >
bool jlm::util::DisjointSet< T >::contains ( const T &  element) const
inlineprivate

Definition at line 400 of file disjointset.hpp.

◆ empty()

template<class T >
bool jlm::util::DisjointSet< T >::empty ( ) const
inlinenoexcept

Definition at line 320 of file disjointset.hpp.

◆ end()

template<class T >
SetIterator jlm::util::DisjointSet< T >::end ( ) const
inline

Definition at line 314 of file disjointset.hpp.

◆ find()

template<class T >
const Set* jlm::util::DisjointSet< T >::find ( const T &  element) const
inlinenoexcept

Definition at line 348 of file disjointset.hpp.

◆ find_or_insert()

template<class T >
const Set* jlm::util::DisjointSet< T >::find_or_insert ( const T &  element)
inlinenoexcept

Definition at line 361 of file disjointset.hpp.

◆ insert() [1/2]

template<class T >
void jlm::util::DisjointSet< T >::insert ( const std::vector< T > &  elements)
inline

Definition at line 289 of file disjointset.hpp.

◆ insert() [2/2]

template<class T >
const Set* jlm::util::DisjointSet< T >::insert ( const T &  element)
inline

Definition at line 296 of file disjointset.hpp.

◆ merge()

template<class T >
const Set* jlm::util::DisjointSet< T >::merge ( const T &  e1,
const T &  e2 
)
inline

Definition at line 373 of file disjointset.hpp.

◆ nsets()

template<class T >
size_t jlm::util::DisjointSet< T >::nsets ( ) const
inlinenoexcept

Definition at line 332 of file disjointset.hpp.

◆ nvalues()

template<class T >
size_t jlm::util::DisjointSet< T >::nvalues ( ) const
inlinenoexcept

Definition at line 326 of file disjointset.hpp.

◆ operator=() [1/2]

template<class T >
DisjointSet& jlm::util::DisjointSet< T >::operator= ( const DisjointSet< T > &  other)
inline

Definition at line 265 of file disjointset.hpp.

◆ operator=() [2/2]

template<class T >
DisjointSet& jlm::util::DisjointSet< T >::operator= ( DisjointSet< T > &&  other)
inline

Definition at line 277 of file disjointset.hpp.

Member Data Documentation

◆ roots_

template<class T >
std::unordered_set<const Set *> jlm::util::DisjointSet< T >::roots_
private

Definition at line 405 of file disjointset.hpp.

◆ values_

template<class T >
std::unordered_map<T, std::unique_ptr<Set> > jlm::util::DisjointSet< T >::values_
private

Definition at line 406 of file disjointset.hpp.


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