From a9ea1f4033896aa160d6bb99ae6133e294eaa073 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sat, 22 Feb 2014 16:28:37 -0500 Subject: [PATCH] Made Roots typedef in BayesTree --- gtsam/inference/BayesTree-inst.h | 4 ++-- gtsam/inference/BayesTree.h | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gtsam/inference/BayesTree-inst.h b/gtsam/inference/BayesTree-inst.h index cbeec97c5..281648409 100644 --- a/gtsam/inference/BayesTree-inst.h +++ b/gtsam/inference/BayesTree-inst.h @@ -413,12 +413,12 @@ namespace gtsam { void BayesTree::removeClique(sharedClique clique) { if (clique->isRoot()) { - typename FastVector::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::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); } diff --git a/gtsam/inference/BayesTree.h b/gtsam/inference/BayesTree.h index 002bbc518..830ddd3ec 100644 --- a/gtsam/inference/BayesTree.h +++ b/gtsam/inference/BayesTree.h @@ -95,7 +95,10 @@ namespace gtsam { Nodes nodes_; /** Root cliques */ - FastVector roots_; + typedef FastVector 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& 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 {