Added assertion to catch size mismatches

release/4.3a0
Alex Cunningham 2012-11-21 19:02:12 +00:00
parent a2e36d66df
commit 69ea8c8b77
1 changed files with 1 additions and 0 deletions

View File

@ -190,6 +190,7 @@ namespace gtsam {
/* ************************************************************************* */
vector<size_t> Values::dims(const Ordering& ordering) const {
assert(ordering.size() == this->size()); // reads off of end of array if difference in size
vector<size_t> result(values_.size());
BOOST_FOREACH(const ConstKeyValuePair& key_value, *this) {
result[ordering[key_value.key]] = key_value.value.dim();