Go to the documentation of this file.
28 DSFBase::DSFBase(
const size_t numNodes) {
29 v_ = std::make_shared < V > (numNodes);
31 for (V::iterator it = v_->begin(); it != v_->end(); it++, index++)
36 DSFBase::DSFBase(
const std::shared_ptr<V>& v_in) {
39 for (V::iterator it = v_->begin(); it != v_->end(); it++, index++)
44 size_t DSFBase::find(
size_t key)
const {
46 size_t parent = (*v_)[
key];
48 parent = find(parent);
54 void DSFBase::merge(
const size_t&
i1,
const size_t& i2) {
55 (*v_)[find(i2)] = find(
i1);
59 DSFVector::DSFVector(
const size_t numNodes) :
61 keys_.reserve(numNodes);
62 for (
size_t index = 0; index < numNodes; index++)
63 keys_.push_back(index);
73 const std::vector<size_t>&
keys) :
75 assert(*(std::max_element(
keys.begin(),
keys.end()))<v_in->size());
94 std::set < size_t >
set;
103 std::map<size_t, std::set<size_t> >
sets;
111 std::map<size_t, std::vector<size_t> >
arrays;
DSFVector(const size_t numNodes)
Constructor that allocates new memory, uses sequential keys 0...numNodes-1.
bool isSingleton(const size_t &label) const
Find whether there is one and only one occurrence for the given {label}.
std::map< size_t, std::vector< size_t > > arrays() const
Return all sets, i.e. a partition of all elements.
A faster implementation for DSF, which uses vector rather than btree.
std::set< size_t > set(const size_t &label) const
Get the nodes in the tree with the given label.
const gtsam::Symbol key('X', 0)
std::map< size_t, std::set< size_t > > sets() const
Return all sets, i.e. a partition of all elements.
static const EIGEN_DEPRECATED end_t end
std::vector< size_t > keys_
stores keys to support more expensive operations
size_t find(size_t key) const
Find the label of the set in which {key} lives.
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:29