Fixed assert error
parent
f2e346525f
commit
c112c217fc
|
|
@ -47,10 +47,10 @@ namespace gtsam {
|
||||||
// Check that keys are all unique
|
// Check that keys are all unique
|
||||||
std::multiset < Key > nonunique(keys_.begin(), keys_.end());
|
std::multiset < Key > nonunique(keys_.begin(), keys_.end());
|
||||||
std::set < Key > unique(keys_.begin(), keys_.end());
|
std::set < Key > unique(keys_.begin(), keys_.end());
|
||||||
bool correct = (nonunique.size() != unique.size())
|
bool correct = (nonunique.size() == unique.size())
|
||||||
&& std::equal(nonunique.begin(), nonunique.end(), unique.begin());
|
&& std::equal(nonunique.begin(), nonunique.end(), unique.begin());
|
||||||
if (!correct)
|
if (!correct) throw std::logic_error(
|
||||||
throw std::logic_error("Factor::assertInvariants: detected inconsistency");
|
"Factor::assertInvariants: detected inconsistency");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue