From a89d08ef302a17aaeb61bf17c008cb80ffe727c8 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Sat, 14 Jan 2012 01:56:16 +0000 Subject: [PATCH] Added groups to Values --- gtsam/nonlinear/Values.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gtsam/nonlinear/Values.h b/gtsam/nonlinear/Values.h index 6a4270b1c..a4bc57c0c 100644 --- a/gtsam/nonlinear/Values.h +++ b/gtsam/nonlinear/Values.h @@ -61,7 +61,7 @@ namespace gtsam { */ typedef J Key; typedef typename J::Value Value; - typedef std::map, boost::fast_pool_allocator > > KeyValueMap; + typedef std::map, boost::fast_pool_allocator > > KeyValueMap; // typedef FastMap KeyValueMap; typedef typename KeyValueMap::value_type KeyValuePair; typedef typename KeyValueMap::iterator iterator; @@ -84,12 +84,17 @@ namespace gtsam { Values(const Values& other) {} // do nothing when initializing with wrong type virtual ~Values() {} + /// @name Testable + /// @{ + /** print */ void print(const std::string &s="") const; /** Test whether configs are identical in keys and values */ bool equals(const Values& expected, double tol=1e-9) const; + /// @} + /** Retrieve a variable by j, throws KeyDoesNotExist if not found */ const Value& at(const J& j) const; @@ -120,7 +125,8 @@ namespace gtsam { iterator begin() { return values_.begin(); } iterator end() { return values_.end(); } - // Manifold operations + /// @name Manifold Operations + /// @{ /** The dimensionality of the tangent space */ size_t dim() const; @@ -134,6 +140,8 @@ namespace gtsam { /** Get a delta config about a linearization point c0 (*this) */ void localCoordinates(const Values& cp, const Ordering& ordering, VectorValues& delta) const; + /// @} + // imperative methods: /** Add a variable with the given j, throws KeyAlreadyExists if j is already present */