fix empty factors bug
parent
11969b32f6
commit
78d9a8cab8
|
|
@ -305,6 +305,7 @@ VectorValues GaussianFactorGraph::gradientAtZero(
|
||||||
// Zero-out the gradient
|
// Zero-out the gradient
|
||||||
VectorValues g;
|
VectorValues g;
|
||||||
BOOST_FOREACH(const sharedFactor& factor, *this) {
|
BOOST_FOREACH(const sharedFactor& factor, *this) {
|
||||||
|
if (!factor) continue;
|
||||||
VectorValues gi = factor->gradientAtZero(negDuals);
|
VectorValues gi = factor->gradientAtZero(negDuals);
|
||||||
g.addInPlace_(gi);
|
g.addInPlace_(gi);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue