#include <DSFVector.h>
Public Types | |
typedef std::vector< size_t > | V |
Vector of ints. More... | |
Public Member Functions | |
DSFBase (const size_t numNodes) | |
Constructor that allocates new memory, allows for keys 0...numNodes-1. More... | |
DSFBase (const std::shared_ptr< V > &v_in) | |
Constructor that uses an existing, pre-allocated vector. More... | |
size_t | find (size_t key) const |
Find the label of the set in which {key} lives. More... | |
void | merge (const size_t &i1, const size_t &i2) |
Merge the sets containing i1 and i2. Does nothing if i1 and i2 are already in the same set. More... | |
Private Attributes | |
std::shared_ptr< V > | v_ |
Stores parent pointers, representative iff v[i]==i. More... | |
A fast implementation of disjoint set forests that uses vector as underly data structure. This is the absolute minimal DSF data structure, and only allows size_t keys Uses rank compression but not union by rank :-(
Definition at line 38 of file DSFVector.h.
typedef std::vector<size_t> gtsam::DSFBase::V |
Vector of ints.
Definition at line 41 of file DSFVector.h.
gtsam::DSFBase::DSFBase | ( | const size_t | numNodes | ) |
Constructor that allocates new memory, allows for keys 0...numNodes-1.
Definition at line 28 of file DSFVector.cpp.
gtsam::DSFBase::DSFBase | ( | const std::shared_ptr< V > & | v_in | ) |
Constructor that uses an existing, pre-allocated vector.
Definition at line 36 of file DSFVector.cpp.
Find the label of the set in which {key} lives.
Definition at line 44 of file DSFVector.cpp.
Merge the sets containing i1 and i2. Does nothing if i1 and i2 are already in the same set.
Definition at line 54 of file DSFVector.cpp.
|
private |
Stores parent pointers, representative iff v[i]==i.
Definition at line 44 of file DSFVector.h.