More changes

release/4.3a0
dellaert 2014-12-03 16:41:11 +01:00
parent 05a733956e
commit c7676f1012
1 changed files with 41 additions and 11 deletions

View File

@ -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 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. `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`. 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 ? typedef const int value_type; // const ?
} }
* Functors: `gtsam::traits::someFunctor<T>`, i.e., they are mixedCase starting with a lowercase letter and define a functor type * Functors: `gtsam::traits::someFunctor<T>::type`, i.e., they are mixedCase starting with a lowercase letter and define a functor `type`. Example
template<> struct Point2::retract {
gtsam::traits::retract<Point2> { Point2 p_;
Point2 operator()(const Point2& p, const Vector2& v) { retract(const Point2& p) : p_(p) {}
return Point2(p.x()+v[0], p.y()+v[1]); 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<Point2> {
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. 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<T>`
Manifold Manifold
-------- --------
`gtsam::tags::manifold_tag` * types: `DefaultChart`
* values: `dimension`
`gtsam::traits::structure_tag<T>` Anything else?
* associated types: DefaultChart
* valid expressions: dimension
Chart Chart
----- -----
* types: `Manifold`, `Vector`
* values: `retract`, `local`
Are these values? They are just methods. Anything else?
Group Group
----- -----
* values: `identity`
* values: `compose`, `inverse`, (`between`)
Lie Group Lie Group
--------- ---------
Implements both MANIFOLD and GROUP
Vector Space Vector Space
------------ ------------
Lie Group where compose == `+`
Examples Examples
-------- --------