Public Types | Public Member Functions | Private Attributes | List of all members
gtsam::DSFBase Class Reference

#include <DSFVector.h>

Inheritance diagram for gtsam::DSFBase:
Inheritance graph
[legend]

Public Types

typedef std::vector< size_tV
 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< Vv_
 Stores parent pointers, representative iff v[i]==i. More...
 

Detailed Description

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.

Member Typedef Documentation

◆ V

typedef std::vector<size_t> gtsam::DSFBase::V

Vector of ints.

Definition at line 41 of file DSFVector.h.

Constructor & Destructor Documentation

◆ DSFBase() [1/2]

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.

◆ DSFBase() [2/2]

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.

Member Function Documentation

◆ find()

size_t gtsam::DSFBase::find ( size_t  key) const

Find the label of the set in which {key} lives.

Definition at line 44 of file DSFVector.cpp.

◆ merge()

void gtsam::DSFBase::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.

Definition at line 54 of file DSFVector.cpp.

Member Data Documentation

◆ v_

std::shared_ptr<V> gtsam::DSFBase::v_
private

Stores parent pointers, representative iff v[i]==i.

Definition at line 44 of file DSFVector.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:46:17