From c7676f10121a20ff488a5ba195b4610a9a36b1d2 Mon Sep 17 00:00:00 2001 From: dellaert Date: Wed, 3 Dec 2014 16:41:11 +0100 Subject: [PATCH] More changes --- GTSAM-Concepts.md | 52 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 11 deletions(-) diff --git a/GTSAM-Concepts.md b/GTSAM-Concepts.md index 6c09cc467..9b848bf51 100644 --- a/GTSAM-Concepts.md +++ b/GTSAM-Concepts.md @@ -10,6 +10,9 @@ Concepts define (see [Generic Programming Techniques](http://www.boost.org/commu GTSAM Types start with Uppercase, e.g., `gtsam::Point2`, and are models of the concepts MANIFOLD, GROUP, LIE_GROUP, VECTOR_SPACE +traits +------ + `gtsam::traits` is our way to associate these concepts with types. We will not use Eigen-style or STL-style traits, that define many properties at once. Rather, we use boost::mpl style meta-programming functions to facilitate meta-programming. Traits allow us to play with types that are outside GTSAM control, e.g., `Eigen::VectorXd`. @@ -31,42 +34,69 @@ The naming conventions are as follows: typedef const int value_type; // const ? } -* Functors: `gtsam::traits::someFunctor`, i.e., they are mixedCase starting with a lowercase letter and define a functor type +* Functors: `gtsam::traits::someFunctor::type`, i.e., they are mixedCase starting with a lowercase letter and define a functor `type`. Example - template<> - gtsam::traits::retract { - Point2 operator()(const Point2& p, const Vector2& v) { - return Point2(p.x()+v[0], p.y()+v[1]); + struct Point2::retract { + Point2 p_; + retract(const Point2& p) : p_(p) {} + Point2 operator()(const Vector2& v) { + return Point2(p.x()+v[0], p.y()+v[1]); } } - The above is still up in the air, can we not point to a function somewhere? Or a method? + template<> + gtsam::traits::retract { + typedef Point2::retract type; + } + + The above is still up in the air. Do we need the type indirection? + +tags +---- Concepts are associated with a tag. +* `gtsam::tags::manifold_tag` +* `gtsam::tags::group_tag` +* `gtsam::tags::lie_group_tag` +* `gtsam::tags::vector_space_tag` + +Can be queried `gtsam::traits::structure_tag` + + Manifold -------- -`gtsam::tags::manifold_tag` +* types: `DefaultChart` +* values: `dimension` -`gtsam::traits::structure_tag` - -* associated types: DefaultChart -* valid expressions: dimension +Anything else? Chart ----- +* types: `Manifold`, `Vector` +* values: `retract`, `local` + +Are these values? They are just methods. Anything else? + Group ----- +* values: `identity` +* values: `compose`, `inverse`, (`between`) + Lie Group --------- +Implements both MANIFOLD and GROUP + Vector Space ------------ +Lie Group where compose == `+` + Examples --------