Add value to concepts
parent
51e89d298e
commit
4cc2e22b59
|
@ -277,6 +277,10 @@ inline Class expmap_default(const Class& t, const Vector& d) {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class IsLieGroup: public IsGroup<T>, public IsManifold<T> {
|
class IsLieGroup: public IsGroup<T>, public IsManifold<T> {
|
||||||
public:
|
public:
|
||||||
|
// Concept marker: allows checking IsLieGroup<T>::value in templates
|
||||||
|
static constexpr bool value =
|
||||||
|
std::is_base_of<lie_group_tag, typename traits<T>::structure_category>::value;
|
||||||
|
|
||||||
typedef typename traits<T>::structure_category structure_category_tag;
|
typedef typename traits<T>::structure_category structure_category_tag;
|
||||||
typedef typename traits<T>::ManifoldType ManifoldType;
|
typedef typename traits<T>::ManifoldType ManifoldType;
|
||||||
typedef typename traits<T>::TangentVector TangentVector;
|
typedef typename traits<T>::TangentVector TangentVector;
|
||||||
|
@ -284,7 +288,7 @@ public:
|
||||||
|
|
||||||
GTSAM_CONCEPT_USAGE(IsLieGroup) {
|
GTSAM_CONCEPT_USAGE(IsLieGroup) {
|
||||||
static_assert(
|
static_assert(
|
||||||
(std::is_base_of<lie_group_tag, structure_category_tag>::value),
|
value,
|
||||||
"This type's trait does not assert it is a Lie group (or derived)");
|
"This type's trait does not assert it is a Lie group (or derived)");
|
||||||
|
|
||||||
// group operations with Jacobians
|
// group operations with Jacobians
|
||||||
|
|
|
@ -138,10 +138,13 @@ public:
|
||||||
static const int dim = traits<T>::dimension;
|
static const int dim = traits<T>::dimension;
|
||||||
typedef typename traits<T>::ManifoldType ManifoldType;
|
typedef typename traits<T>::ManifoldType ManifoldType;
|
||||||
typedef typename traits<T>::TangentVector TangentVector;
|
typedef typename traits<T>::TangentVector TangentVector;
|
||||||
|
// Concept marker: allows checking IsManifold<T>::value in templates
|
||||||
|
static constexpr bool value =
|
||||||
|
std::is_base_of<manifold_tag, structure_category_tag>::value;
|
||||||
|
|
||||||
GTSAM_CONCEPT_USAGE(IsManifold) {
|
GTSAM_CONCEPT_USAGE(IsManifold) {
|
||||||
static_assert(
|
static_assert(
|
||||||
(std::is_base_of<manifold_tag, structure_category_tag>::value),
|
value,
|
||||||
"This type's structure_category trait does not assert it as a manifold (or derived)");
|
"This type's structure_category trait does not assert it as a manifold (or derived)");
|
||||||
static_assert(TangentVector::SizeAtCompileTime == dim);
|
static_assert(TangentVector::SizeAtCompileTime == dim);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue