From 275c0ff4d3a60b7cf517c83b308c6bc77b94ed7d Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sun, 4 Mar 2012 17:25:10 +0000 Subject: [PATCH] More helpful error message --- gtsam/inference/Factor-inl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gtsam/inference/Factor-inl.h b/gtsam/inference/Factor-inl.h index d05cc1de3..d9fb1e0de 100644 --- a/gtsam/inference/Factor-inl.h +++ b/gtsam/inference/Factor-inl.h @@ -45,12 +45,12 @@ namespace gtsam { void Factor::assertInvariants() const { #ifndef NDEBUG // Check that keys are all unique - std::multiset < KeyType > nonunique(keys_.begin(), keys_.end()); - std::set < KeyType > unique(keys_.begin(), keys_.end()); + std::multiset nonunique(keys_.begin(), keys_.end()); + std::set unique(keys_.begin(), keys_.end()); bool correct = (nonunique.size() == unique.size()) && std::equal(nonunique.begin(), nonunique.end(), unique.begin()); if (!correct) throw std::logic_error( - "Factor::assertInvariants: detected inconsistency"); + "Factor::assertInvariants: Factor contains duplicate keys"); #endif }