diff --git a/gtsam/base/FastList.h b/gtsam/base/FastList.h index 5c80799ce..a03121024 100644 --- a/gtsam/base/FastList.h +++ b/gtsam/base/FastList.h @@ -62,6 +62,11 @@ public: Base::assign(x.begin(), x.end()); } + /** Conversion to a standard STL container */ + operator std::list() const { + return std::list(this->begin(), this->end()); + } + private: /** Serialization function */ friend class boost::serialization::access; diff --git a/gtsam/base/FastMap.h b/gtsam/base/FastMap.h index ab448de07..7cea45e88 100644 --- a/gtsam/base/FastMap.h +++ b/gtsam/base/FastMap.h @@ -53,6 +53,11 @@ public: /** Copy constructor from the base map class */ FastMap(const Base& x) : Base(x) {} + /** Conversion to a standard STL container */ + operator std::map() const { + return std::map(this->begin(), this->end()); + } + private: /** Serialization function */ friend class boost::serialization::access; diff --git a/gtsam/base/FastSet.h b/gtsam/base/FastSet.h index 6076c7f03..be2864f8f 100644 --- a/gtsam/base/FastSet.h +++ b/gtsam/base/FastSet.h @@ -86,6 +86,11 @@ public: Base::insert(x.begin(), x.end()); } + /** Conversion to a standard STL container */ + operator std::set() const { + return std::set(this->begin(), this->end()); + } + /** Print to implement Testable */ void print(const std::string& str = "") const { FastSetTestableHelper::print(*this, str); } diff --git a/gtsam/inference/BayesTree.h b/gtsam/inference/BayesTree.h index c09208c77..bd0e030fb 100644 --- a/gtsam/inference/BayesTree.h +++ b/gtsam/inference/BayesTree.h @@ -229,6 +229,11 @@ namespace gtsam { root_->deleteCachedShorcuts(); } + /** Apply a permutation to all cliques */ + void permuteWithInverse(const Permutation& inversePermutation) { + root_->permuteWithInverse(inversePermutation); + } + /** * Remove path from clique to root and return that path as factors * plus a list of orphaned subtree roots. Used in removeTop below.