Added matlab interface to access cliques by index from BayesTree

release/4.3a0
Alex Cunningham 2013-02-04 17:55:55 +00:00
parent a8f5bbf9bd
commit 059a2c1b97
2 changed files with 8 additions and 1 deletions

View File

@ -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<CONDITIONAL>
@ -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;

View File

@ -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);
}