fixed bug with null factors in GaussianFactorGraphs
parent
c9ead8bbd3
commit
b89c33977a
|
@ -138,8 +138,10 @@ namespace gtsam {
|
||||||
/** unnormalized error */
|
/** unnormalized error */
|
||||||
double error(const VectorValues& x) const {
|
double error(const VectorValues& x) const {
|
||||||
double total_error = 0.;
|
double total_error = 0.;
|
||||||
BOOST_FOREACH(const sharedFactor& factor, *this)
|
BOOST_FOREACH(const sharedFactor& factor, *this){
|
||||||
|
if(factor)
|
||||||
total_error += factor->error(x);
|
total_error += factor->error(x);
|
||||||
|
}
|
||||||
return total_error;
|
return total_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue