Fix in BayesTree shortcuts

release/4.3a0
Richard Roberts 2013-08-06 16:10:12 +00:00
parent 61fe49ab7e
commit b6c404ff79
1 changed files with 2 additions and 8 deletions

View File

@ -120,14 +120,8 @@ namespace gtsam {
std::vector<Key> keep = shortcut_indices(B, p_Cp_B);
// Marginalize out everything except S union B
BayesNetType result = *p_Cp_B.marginalMultifrontalBayesNet(
Ordering(keep), boost::none, function);
// Finally, we only want to have S\B variables in the Bayes net, so
size_t nrFrontals = S_setminus_B.size();
result.erase(result.begin() + nrFrontals, result.end());
return result;
boost::shared_ptr<FactorGraphType> p_S_B = p_Cp_B.marginal(keep, function);
return *p_S_B->eliminatePartialSequential(S_setminus_B, function).first;
}
else
{