diff --git a/gtsam/base/concepts.h b/gtsam/base/concepts.h index e4f5924de..b231dfe0d 100644 --- a/gtsam/base/concepts.h +++ b/gtsam/base/concepts.h @@ -10,6 +10,7 @@ #include "manifold.h" #include "chart.h" +#include namespace gtsam { @@ -31,9 +32,15 @@ struct DefaultChart { //typedef XXX type; }; +template +struct structure {}; // specializations should be derived from one of the following tags +struct manifold_tag {}; +struct group_tag {}; +struct lie_group_tag : public manifold_tag, public group_tag {}; +struct vector_space_tag : public lie_group_tag {}; + template struct group_flavor {}; - struct additive_group_tag {}; struct multiplicative_group_tag {}; @@ -43,11 +50,13 @@ template class ManifoldConcept { public: typedef T Manifold; + typedef traits::manifold_tag manifold_tag; typedef traits::TangentVector::type TangentVector; typedef traits::DefaultChart::type DefaultChart; static const size_t dim = traits::dimension::value; BOOST_CONCEPT_USAGE(ManifoldConcept) { + BOOST_STATIC_ASSERT(boost::is_base_of >); BOOST_STATIC_ASSERT(TangentVector::SizeAtCompileTime == dim); // no direct usage for manifold since most usage is through a chart } @@ -81,6 +90,7 @@ class GroupConcept { static const Group identity = traits::identity::value; BOOST_CONCEPT_USAGE(GroupConcept) { + BOOST_STATIC_ASSERT(boost::is_base_of >); Group ip = inverse(p); Group pq = compose(p, q); Group d = between(p, q); @@ -108,6 +118,16 @@ class GroupConcept { }; +template +class LieGroupConcept : public GroupConcept, public ManifoldConcept { + + BOOST_CONCEPT_USAGE(LieGroupConcept) { + BOOST_STATIC_ASSERT(boost::is_base_of >); + } +}; + + + } // namespace gtsam #endif /* CONCEPTS_H_ */