Fix equality
parent
846c7a1a99
commit
21171b3a9a
|
@ -192,11 +192,10 @@ bool HybridGaussianConditional::equals(const HybridFactor &lf,
|
||||||
|
|
||||||
// Check the base and the factors:
|
// Check the base and the factors:
|
||||||
return BaseFactor::equals(*e, tol) &&
|
return BaseFactor::equals(*e, tol) &&
|
||||||
conditionals_.equals(e->conditionals_,
|
conditionals_.equals(
|
||||||
[tol](const GaussianConditional::shared_ptr &f1,
|
e->conditionals_, [tol](const auto &f1, const auto &f2) {
|
||||||
const GaussianConditional::shared_ptr &f2) {
|
return (!f1 && !f2) || (f1 && f2 && f1->equals(*f2, tol));
|
||||||
return f1->equals(*(f2), tol);
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *******************************************************************************/
|
/* *******************************************************************************/
|
||||||
|
|
|
@ -154,10 +154,9 @@ bool HybridGaussianFactor::equals(const HybridFactor &lf, double tol) const {
|
||||||
|
|
||||||
// Check the base and the factors:
|
// Check the base and the factors:
|
||||||
return Base::equals(*e, tol) &&
|
return Base::equals(*e, tol) &&
|
||||||
factors_.equals(e->factors_,
|
factors_.equals(e->factors_, [tol](const auto &f1, const auto &f2) {
|
||||||
[tol](const sharedFactor &f1, const sharedFactor &f2) {
|
return (!f1 && !f2) || (f1 && f2 && f1->equals(*f2, tol));
|
||||||
return f1->equals(*f2, tol);
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *******************************************************************************/
|
/* *******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue