File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 1+ // / @file
2+ // / @copyright Copyright (C) 2025 INRIA
3+ #pragma once
4+
5+ #include " aligator/fwd.hpp"
6+
7+ namespace aligator {
8+
9+ template <typename Derived> struct LieAlgebraTraits ;
10+
11+ // / @brief Base CRTP for Lie algebras.
12+ template <typename Derived> struct LieAlgebraBase {
13+ using Traits = LieAlgebraTraits<Derived>;
14+ };
15+
16+ } // namespace aligator
Original file line number Diff line number Diff line change 1+ // / @file
2+ // / @copyright Copyright (C) 2025 INRIA
3+ #pragma once
4+
5+ #include " aligator/fwd.hpp"
6+
7+ namespace aligator {
8+
9+ // / @brief Type traits for a Lie group. Usually required are the Lie group
10+ // / dimension, corresponding Lie Algebra, etc.
11+ template <typename Derived> struct LieGroupTraits {
12+ using Scalar = typename Derived::Scalar;
13+ static constexpr int Dim = Derived::Dim;
14+ };
15+
16+ #define ALIGATOR_LIEGROUP_TRAITS_DEFINE (Traits ) \
17+ using Scalar = typename Traits::Derived; \
18+ static constexpr int Dim = Traits::Dim; \
19+ using LieAlgebraType = typename Traits::LieAlgebraType; \
20+ using DualLieAlgebraType = typename Traits::DualLieAlgebraType
21+
22+ template <typename Derived> struct LieGroupBase {
23+ using Traits = LieGroupTraits<Derived>;
24+ ALIGATOR_LIEGROUP_TRAITS_DEFINE (Traits);
25+
26+ Derived &derived () { return static_cast <Derived &>(*this ); }
27+
28+ const Derived &derived () const { return static_cast <const Derived &>(*this ); }
29+
30+ Derived &const_cast_derived () const {
31+ return const_cast <Derived &>(derived ());
32+ }
33+ };
34+
35+ } // namespace aligator
You can’t perform that action at this time.
0 commit comments