fixed orphans bug

release/4.3a0
Frank Dellaert 2009-11-22 18:22:17 +00:00
parent 9da2f16f4d
commit 952798e751
2 changed files with 5 additions and 4 deletions

View File

@ -402,10 +402,11 @@ namespace gtsam {
// only add if key is not yet in the factor graph
if (!factors.involves(key)) {
// get the clique
// get the clique and remove it from orphans (if it exists)
sharedClique clique = (*this)[key];
orphans.remove(clique);
// remove path above this clique
// remove path from clique to root
FactorGraph<Factor> factors1; Cliques orphans1;
boost::tie(factors1,orphans1) = removePath<Factor>(clique);

View File

@ -364,7 +364,7 @@ TEST( BayesTree, removePath2 )
{
SymbolicBayesTree bayesTree = createAsiaSymbolicBayesTree();
// Call remove-path with clique S
// Call remove-path with clique B
FactorGraph<SymbolicFactor> factors;
SymbolicBayesTree::Cliques orphans;
boost::tie(factors,orphans) = bayesTree.removePath<SymbolicFactor>(bayesTree["B"]);
@ -427,7 +427,7 @@ TEST( BayesTree, removeTop )
CHECK(assert_equal((FactorGraph<SymbolicFactor>)expected, factors));
SymbolicBayesTree::Cliques expectedOrphans;
expectedOrphans += bayesTree["T"], bayesTree["X"];
//CHECK(assert_equal(expectedOrphans, orphans));
CHECK(assert_equal(expectedOrphans, orphans));
}
/* ************************************************************************* */