Fixed factor equals
parent
653d4ef131
commit
94560fcc45
|
@ -129,16 +129,17 @@ void LinearizedFactor::print(const std::string& s, const KeyFormatter& keyFormat
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
bool LinearizedFactor::equals(const LinearizedFactor& other, double tol) const {
|
bool LinearizedFactor::equals(const NonlinearFactor& other, double tol) const {
|
||||||
if (!Base::equals(other, tol)
|
const LinearizedFactor* e = dynamic_cast<const LinearizedFactor*>(&other);
|
||||||
|| !lin_points_.equals(other.lin_points_, tol)
|
if (!e || !Base::equals(other, tol)
|
||||||
|| !equal_with_abs_tol(b_, other.b_, tol)
|
|| !lin_points_.equals(e->lin_points_, tol)
|
||||||
|| !model_->equals(*other.model_, tol)
|
|| !equal_with_abs_tol(b_, e->b_, tol)
|
||||||
|| matrices_.size() != other.matrices_.size())
|
|| !model_->equals(*e->model_, tol)
|
||||||
|
|| matrices_.size() != e->matrices_.size())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
KeyMatrixMap::const_iterator map1 = matrices_.begin(), map2 = other.matrices_.begin();
|
KeyMatrixMap::const_iterator map1 = matrices_.begin(), map2 = e->matrices_.begin();
|
||||||
for (; map1 != matrices_.end(), map2 != other.matrices_.end(); ++map1, ++map2)
|
for (; map1 != matrices_.end(), map2 != e->matrices_.end(); ++map1, ++map2)
|
||||||
if ((map1->first != map2->first) || !equal_with_abs_tol(map1->second, map2->second, tol))
|
if ((map1->first != map2->first) || !equal_with_abs_tol(map1->second, map2->second, tol))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -100,7 +100,7 @@ public:
|
||||||
virtual void print(const std::string& s="", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
virtual void print(const std::string& s="", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
||||||
|
|
||||||
/** equals function with optional tolerance */
|
/** equals function with optional tolerance */
|
||||||
virtual bool equals(const LinearizedFactor& other, double tol = 1e-9) const;
|
virtual bool equals(const NonlinearFactor& other, double tol = 1e-9) const;
|
||||||
|
|
||||||
// access functions
|
// access functions
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue