Added assertions to check for valid pointer values

release/4.3a0
Alex Cunningham 2012-10-08 19:11:02 +00:00
parent 936081a05d
commit a004354c20
2 changed files with 4 additions and 0 deletions

View File

@ -155,6 +155,8 @@ typename EliminationTree<FACTOR>::shared_ptr EliminationTree<FACTOR>::Create(
if(debug)
trees.back()->print("ETree: ");
// Check that this is not null
assert(trees.back().get());
return trees.back();
}

View File

@ -34,9 +34,11 @@ namespace gtsam {
gttic(JT_symbolic_ET);
const typename EliminationTree<IndexFactor>::shared_ptr symETree =
EliminationTree<IndexFactor>::Create(fg, variableIndex);
assert(symETree.get());
gttoc(JT_symbolic_ET);
gttic(JT_symbolic_eliminate);
SymbolicBayesNet::shared_ptr sbn = symETree->eliminate(&EliminateSymbolic);
assert(sbn.get());
gttoc(JT_symbolic_eliminate);
gttic(symbolic_BayesTree);
SymbolicBayesTree sbt(*sbn);