Added conversion functions from Fast* classes to stl containers. Added permuteWithInverse() to BayesTree
parent
a004354c20
commit
82593a2432
|
|
@ -62,6 +62,11 @@ public:
|
|||
Base::assign(x.begin(), x.end());
|
||||
}
|
||||
|
||||
/** Conversion to a standard STL container */
|
||||
operator std::list<VALUE>() const {
|
||||
return std::list<VALUE>(this->begin(), this->end());
|
||||
}
|
||||
|
||||
private:
|
||||
/** Serialization function */
|
||||
friend class boost::serialization::access;
|
||||
|
|
|
|||
|
|
@ -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<KEY,VALUE>() const {
|
||||
return std::map<KEY,VALUE>(this->begin(), this->end());
|
||||
}
|
||||
|
||||
private:
|
||||
/** Serialization function */
|
||||
friend class boost::serialization::access;
|
||||
|
|
|
|||
|
|
@ -86,6 +86,11 @@ public:
|
|||
Base::insert(x.begin(), x.end());
|
||||
}
|
||||
|
||||
/** Conversion to a standard STL container */
|
||||
operator std::set<VALUE>() const {
|
||||
return std::set<VALUE>(this->begin(), this->end());
|
||||
}
|
||||
|
||||
/** Print to implement Testable */
|
||||
void print(const std::string& str = "") const { FastSetTestableHelper<VALUE>::print(*this, str); }
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue