Fixed bug in FactorGraph::eliminate - was not unpermuting the removed factors - even though they're removed, since they're shared, they can be used still in other graphs
parent
3a62daf985
commit
d9ef381483
|
|
@ -184,8 +184,7 @@ namespace gtsam {
|
|||
Permutation toFront = Permutation::PullToFront(variables, highestInvolvedVariable+1);
|
||||
Permutation toFrontInverse = *toFront.inverse();
|
||||
BOOST_FOREACH(const sharedFactor& factor, involvedFactors) {
|
||||
factor->permuteWithInverse(toFrontInverse);
|
||||
}
|
||||
factor->permuteWithInverse(toFrontInverse); }
|
||||
|
||||
// Eliminate into conditional and remaining factor
|
||||
EliminationResult eliminated = eliminateFcn(involvedFactors, variables.size());
|
||||
|
|
@ -193,6 +192,8 @@ namespace gtsam {
|
|||
remainingFactor = eliminated.second;
|
||||
|
||||
// Undo the permutation
|
||||
BOOST_FOREACH(const sharedFactor& factor, involvedFactors) {
|
||||
factor->permuteWithInverse(toFront); }
|
||||
conditional->permuteWithInverse(toFront);
|
||||
remainingFactor->permuteWithInverse(toFront);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue