Made Roots typedef in BayesTree
parent
c5338811a0
commit
a9ea1f4033
|
|
@ -413,12 +413,12 @@ namespace gtsam {
|
|||
void BayesTree<CLIQUE>::removeClique(sharedClique clique)
|
||||
{
|
||||
if (clique->isRoot()) {
|
||||
typename FastVector<sharedClique>::iterator root = std::find(roots_.begin(), roots_.end(), clique);
|
||||
typename Roots::iterator root = std::find(roots_.begin(), roots_.end(), clique);
|
||||
if(root != roots_.end())
|
||||
roots_.erase(root);
|
||||
} else { // detach clique from parent
|
||||
sharedClique parent = clique->parent_.lock();
|
||||
typename FastVector<sharedClique>::iterator child = std::find(parent->children.begin(), parent->children.end(), clique);
|
||||
typename Roots::iterator child = std::find(parent->children.begin(), parent->children.end(), clique);
|
||||
assert(child != parent->children.end());
|
||||
parent->children.erase(child);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,10 @@ namespace gtsam {
|
|||
Nodes nodes_;
|
||||
|
||||
/** Root cliques */
|
||||
FastVector<sharedClique> roots_;
|
||||
typedef FastVector<sharedClique> Roots;
|
||||
|
||||
/** Root cliques */
|
||||
Roots roots_;
|
||||
|
||||
/// @name Standard Constructors
|
||||
/// @{
|
||||
|
|
@ -141,7 +144,7 @@ namespace gtsam {
|
|||
const sharedNode operator[](Key j) const { return nodes_.at(j); }
|
||||
|
||||
/** return root cliques */
|
||||
const FastVector<sharedClique>& roots() const { return roots_; }
|
||||
const Roots& roots() const { return roots_; }
|
||||
|
||||
/** alternate syntax for matlab: find the clique that contains the variable with Key j */
|
||||
const sharedClique& clique(Key j) const {
|
||||
|
|
|
|||
Loading…
Reference in New Issue