Fixed check for zero-row jacobians in Scatter

release/4.3a0
Richard Roberts 2013-08-09 21:52:24 +00:00
parent 789f2bee97
commit a056ba2095
1 changed files with 4 additions and 1 deletions

View File

@ -70,6 +70,9 @@ Scatter::Scatter(const GaussianFactorGraph& gfg, boost::optional<const Ordering&
BOOST_FOREACH(const GaussianFactor::shared_ptr& factor, gfg) {
if(factor) {
for(GaussianFactor::const_iterator variable = factor->begin(); variable != factor->end(); ++variable) {
// TODO: Fix this hack to cope with zero-row Jacobians that come from BayesTreeOrphanWrappers
const JacobianFactor* asJacobian = dynamic_cast<const JacobianFactor*>(factor.get());
if(!asJacobian || asJacobian->rows() > 0)
this->insert(make_pair(*variable, SlotEntry(none, factor->getDim(variable))));
}
}