optimization over cliques started

release/4.3a0
Michael Kaess 2009-12-09 20:49:04 +00:00
parent 638b174541
commit 34e913e236
1 changed files with 18 additions and 0 deletions

View File

@ -17,10 +17,28 @@
#include "Testable.h"
#include "BayesTree.h"
#include "VectorConfig.h"
#include "GaussianConditional.h"
namespace gtsam {
typedef BayesTree<GaussianConditional> GaussianBayesTree;
#if 0
// recursively optimize starting with this conditional and all children
void optimize(sharedClique clique, VectorConfig& result) {
// parents are assumed to already be solved and available in result
BOOST_REVERSE_FOREACH(GaussianConditional::shared_ptr cg, clique) {
Vector x = cg->solve(result); // Solve for that variable
result.insert(cg->key(),x); // store result in partial solution
}
BOOST_FOREACH(sharedClique child, clique->children_) {
optimize(child, result);
}
}
void optimize(const GaussianBayesTree& bayesTree, VectorConfig& result) {
// starting from the root, call optimize on each conditional
optimize(bayesTree.root(), result);
}
#endif
} /// namespace gtsam