Add value to concepts

release/4.3a0
Frank Dellaert 2025-04-29 00:20:04 -04:00
parent 51e89d298e
commit 4cc2e22b59
2 changed files with 9 additions and 2 deletions

View File

@ -277,6 +277,10 @@ inline Class expmap_default(const Class& t, const Vector& d) {
template<typename T>
class IsLieGroup: public IsGroup<T>, public IsManifold<T> {
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>::ManifoldType ManifoldType;
typedef typename traits<T>::TangentVector TangentVector;
@ -284,7 +288,7 @@ public:
GTSAM_CONCEPT_USAGE(IsLieGroup) {
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)");
// group operations with Jacobians

View File

@ -138,10 +138,13 @@ public:
static const int dim = traits<T>::dimension;
typedef typename traits<T>::ManifoldType ManifoldType;
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) {
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)");
static_assert(TangentVector::SizeAtCompileTime == dim);