diff --git a/gtsam.h b/gtsam.h index 540b4246c..8358a8e86 100644 --- a/gtsam.h +++ b/gtsam.h @@ -818,6 +818,7 @@ virtual class BayesTree { void deleteCachedShortcuts(); void insert(const CLIQUE* subtree); size_t numCachedSeparatorMarginals() const; + CLIQUE* clique(size_t j) const; }; template @@ -1143,6 +1144,7 @@ virtual class GaussianBayesTree : gtsam::GaussianBayesTreeBase { gtsam::VectorValues optimize(const gtsam::GaussianBayesTree& bayesTree); gtsam::VectorValues optimizeGradientSearch(const gtsam::GaussianBayesTree& bayesTree); gtsam::VectorValues gradient(const gtsam::GaussianBayesTree& bayesTree, const gtsam::VectorValues& x0); +gtsam::VectorValues* allocateVectorValues(const gtsam::GaussianBayesTree& bt); virtual class GaussianFactor { void print(string s) const; diff --git a/gtsam/inference/BayesTree.h b/gtsam/inference/BayesTree.h index 8e09da31d..acf821bb7 100644 --- a/gtsam/inference/BayesTree.h +++ b/gtsam/inference/BayesTree.h @@ -174,7 +174,12 @@ namespace gtsam { const sharedClique& root() const { return root_; } /** find the clique that contains the variable with Index j */ - sharedClique operator[](Index j) const { + inline sharedClique operator[](Index j) const { + return nodes_.at(j); + } + + /** alternate syntax for matlab: find the clique that contains the variable with Index j */ + inline sharedClique clique(Index j) const { return nodes_.at(j); }