replace last combine call

release/4.3a0
kartik arcot 2023-01-20 18:04:32 -08:00
parent 769ecd3e96
commit 68e987ea62
1 changed files with 4 additions and 3 deletions

View File

@ -17,7 +17,6 @@
#include <gtsam/discrete/DiscreteValues.h>
#include <boost/range/combine.hpp>
#include <sstream>
using std::cout;
@ -39,8 +38,10 @@ void DiscreteValues::print(const string& s,
/* ************************************************************************ */
bool DiscreteValues::equals(const DiscreteValues& x, double tol) const {
if (this->size() != x.size()) return false;
for (const auto values : boost::combine(*this, x)) {
if (values.get<0>() != values.get<1>()) return false;
auto it1 = x.begin();
auto it2 = this->begin();
for (; it1 != x.end(); ++it1, ++it2) {
if (it1->first != it2->first || it1->second != it2->second) return false;
}
return true;
}