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 toFront = Permutation::PullToFront(variables, highestInvolvedVariable+1);
|
||||||
Permutation toFrontInverse = *toFront.inverse();
|
Permutation toFrontInverse = *toFront.inverse();
|
||||||
BOOST_FOREACH(const sharedFactor& factor, involvedFactors) {
|
BOOST_FOREACH(const sharedFactor& factor, involvedFactors) {
|
||||||
factor->permuteWithInverse(toFrontInverse);
|
factor->permuteWithInverse(toFrontInverse); }
|
||||||
}
|
|
||||||
|
|
||||||
// Eliminate into conditional and remaining factor
|
// Eliminate into conditional and remaining factor
|
||||||
EliminationResult eliminated = eliminateFcn(involvedFactors, variables.size());
|
EliminationResult eliminated = eliminateFcn(involvedFactors, variables.size());
|
||||||
|
|
@ -193,6 +192,8 @@ namespace gtsam {
|
||||||
remainingFactor = eliminated.second;
|
remainingFactor = eliminated.second;
|
||||||
|
|
||||||
// Undo the permutation
|
// Undo the permutation
|
||||||
|
BOOST_FOREACH(const sharedFactor& factor, involvedFactors) {
|
||||||
|
factor->permuteWithInverse(toFront); }
|
||||||
conditional->permuteWithInverse(toFront);
|
conditional->permuteWithInverse(toFront);
|
||||||
remainingFactor->permuteWithInverse(toFront);
|
remainingFactor->permuteWithInverse(toFront);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue