add makeUnionInPlace

release/4.3a0
Kai Ni 2010-05-08 20:11:19 +00:00
parent 2d80c7c1cd
commit d5143347d9
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ namespace gtsam {
// return a new DSF where x and y are in the same set. Kai: the caml implementation is not const, and I followed
Self makeUnion(const Key& key1, const Key& key2) { return this->add(findSet_(key2), findSet_(key1)); }
// the in-place version of makeUnion
void makeUnionInPlace(const Key& key1, const Key& key2) { *this = this->add(findSet_(key2), findSet_(key1)); }
// create a new singleton with two connected keys
Self makePair(const Key& key1, const Key& key2) const { return makeSet(key1).makeSet(key2).makeUnion(key1, key2); }