diff --git a/nonlinear/LieConfig-inl.h b/nonlinear/LieConfig-inl.h index 00f5b061f..8695f268e 100644 --- a/nonlinear/LieConfig-inl.h +++ b/nonlinear/LieConfig-inl.h @@ -32,7 +32,7 @@ namespace gtsam { template void LieConfig::print(const string &s) const { cout << "LieConfig " << s << ", size " << values_.size() << "\n"; - BOOST_FOREACH(const typename Values::value_type& v, values_) { + BOOST_FOREACH(const KeyValuePair& v, values_) { gtsam::print(v.second, (string)(v.first)); } } @@ -41,7 +41,7 @@ namespace gtsam { template bool LieConfig::equals(const LieConfig& expected, double tol) const { if (values_.size() != expected.values_.size()) return false; - BOOST_FOREACH(const typename Values::value_type& v, values_) { + BOOST_FOREACH(const KeyValuePair& v, values_) { if (!expected.exists(v.first)) return false; if(!gtsam::equal(v.second, expected[v.first], tol)) return false; @@ -61,7 +61,7 @@ namespace gtsam { template size_t LieConfig::dim() const { size_t n = 0; - BOOST_FOREACH(const typename Values::value_type& value, values_) + BOOST_FOREACH(const KeyValuePair& value, values_) n += value.second.dim(); return n; } @@ -70,7 +70,7 @@ namespace gtsam { template VectorConfig LieConfig::zero() const { VectorConfig z; - BOOST_FOREACH(const typename Values::value_type& value, values_) + BOOST_FOREACH(const KeyValuePair& value, values_) z.insert(value.first,gtsam::zero(value.second.dim())); return z; } @@ -84,14 +84,14 @@ namespace gtsam { /* ************************************************************************* */ template void LieConfig::insert(const LieConfig& cfg) { - BOOST_FOREACH(const typename Values::value_type& v, cfg.values_) + BOOST_FOREACH(const KeyValuePair& v, cfg.values_) insert(v.first, v.second); } /* ************************************************************************* */ template void LieConfig::update(const LieConfig& cfg) { - BOOST_FOREACH(const typename Values::value_type& v, values_) { + BOOST_FOREACH(const KeyValuePair& v, values_) { boost::optional t = cfg.exists_(v.first); if (t) values_[v.first] = *t; } @@ -107,7 +107,7 @@ namespace gtsam { template std::list LieConfig::keys() const { std::list ret; - BOOST_FOREACH(const typename Values::value_type& v, values_) + BOOST_FOREACH(const KeyValuePair& v, values_) ret.push_back(v.first); return ret; } diff --git a/nonlinear/LieConfig.h b/nonlinear/LieConfig.h index 64744e47b..862acb9da 100644 --- a/nonlinear/LieConfig.h +++ b/nonlinear/LieConfig.h @@ -49,13 +49,14 @@ namespace gtsam { */ typedef J Key; typedef typename J::Value_t Value; - typedef std::map Values; - typedef typename Values::iterator iterator; - typedef typename Values::const_iterator const_iterator; + typedef std::map KeyValueMap; + typedef typename KeyValueMap::value_type KeyValuePair; + typedef typename KeyValueMap::iterator iterator; + typedef typename KeyValueMap::const_iterator const_iterator; private: - Values values_; + KeyValueMap values_; public: diff --git a/nonlinear/tests/testLieConfig.cpp b/nonlinear/tests/testLieConfig.cpp index 434d892ff..85366850d 100644 --- a/nonlinear/tests/testLieConfig.cpp +++ b/nonlinear/tests/testLieConfig.cpp @@ -1,8 +1,6 @@ -/* - * testLieConfig.cpp - * - * Created on: Jan 5, 2010 - * Author: richard +/** + * @file testLieConfig.cpp + * @author Richard Roberts */ #include