fix warnings

release/4.3a0
Duy-Nguyen Ta 2013-10-11 20:26:50 +00:00
parent 19d64460ba
commit 00f109e88f
3 changed files with 23 additions and 16 deletions

View File

@ -45,8 +45,9 @@ namespace gtsam {
/* ************************************************************************* */ /* ************************************************************************* */
bool DecisionTreeFactor::equals(const DiscreteFactor& other, double tol) const { bool DecisionTreeFactor::equals(const DiscreteFactor& other, double tol) const {
if(!dynamic_cast<const DecisionTreeFactor*>(&other)) if(!dynamic_cast<const DecisionTreeFactor*>(&other)) {
return false; return false;
}
else { else {
const DecisionTreeFactor& f(static_cast<const DecisionTreeFactor&>(other)); const DecisionTreeFactor& f(static_cast<const DecisionTreeFactor&>(other));
return Potentials::equals(f, tol); return Potentials::equals(f, tol);

View File

@ -72,9 +72,15 @@ void DiscreteConditional::print(const std::string& s,
} }
/* ******************************************************************************** */ /* ******************************************************************************** */
bool DiscreteConditional::equals(const DiscreteConditional& other, bool DiscreteConditional::equals(const DiscreteFactor& other,
double tol) const { double tol) const {
return Potentials::equals(other, tol); if (!dynamic_cast<const DecisionTreeFactor*>(&other))
return false;
else {
const DecisionTreeFactor& f(
static_cast<const DecisionTreeFactor&>(other));
return DecisionTreeFactor::equals(f, tol);
}
} }
/* ******************************************************************************** */ /* ******************************************************************************** */

View File

@ -82,7 +82,7 @@ public:
const IndexFormatter& formatter = DefaultIndexFormatter) const; const IndexFormatter& formatter = DefaultIndexFormatter) const;
/// GTSAM-style equals /// GTSAM-style equals
bool equals(const DiscreteConditional& other, double tol = 1e-9) const; bool equals(const DiscreteFactor& other, double tol = 1e-9) const;
/// @} /// @}
/// @name Standard Interface /// @name Standard Interface