diff --git a/README.md b/README.md index 65f2b6968..dbf7edbb2 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,8 @@ Please also consider citing the reference paper for the ProxDDP algorithm: * [Ludovic De Matteïs](https://github.com/LudovicDeMatteis) (LAAS-CNRS/Inria): feature developer * [Ewen Dantec](https://edantec.github.io/) (Inria): feature developer * [Antoine Bussy](https://github.com/antoine-bussy) (Aldebaran) -* [Valentin Tordjman--Levavasseur](https://github.com/Tordjx) (Inria): feature developper +* [Valentin Tordjman--Levavasseur](https://github.com/Tordjx) (Inria): feature developer +* [Yann de Mont-Marin](https://github.com/ymontmarin) (Inria): Lie group formalism and associated features ## Acknowledgments diff --git a/include/aligator/core/lie-algebra.hpp b/include/aligator/core/lie-algebra.hpp new file mode 100644 index 000000000..a6a4b0480 --- /dev/null +++ b/include/aligator/core/lie-algebra.hpp @@ -0,0 +1,16 @@ +/// @file +/// @copyright Copyright (C) 2025 INRIA +#pragma once + +#include "aligator/fwd.hpp" + +namespace aligator { + +template struct LieAlgebraTraits; + +/// @brief Base CRTP for Lie algebras. +template struct LieAlgebraBase { + using Traits = LieAlgebraTraits; +}; + +} // namespace aligator diff --git a/include/aligator/core/lie-group-base.hpp b/include/aligator/core/lie-group-base.hpp new file mode 100644 index 000000000..78c97410d --- /dev/null +++ b/include/aligator/core/lie-group-base.hpp @@ -0,0 +1,35 @@ +/// @file +/// @copyright Copyright (C) 2025 INRIA +#pragma once + +#include "aligator/fwd.hpp" + +namespace aligator { + +/// @brief Type traits for a Lie group. Usually required are the Lie group +/// dimension, corresponding Lie Algebra, etc. +template struct LieGroupTraits { + using Scalar = typename Derived::Scalar; + static constexpr int Dim = Derived::Dim; +}; + +#define ALIGATOR_LIEGROUP_TRAITS_DEFINE(Traits) \ + using Scalar = typename Traits::Derived; \ + static constexpr int Dim = Traits::Dim; \ + using LieAlgebraType = typename Traits::LieAlgebraType; \ + using DualLieAlgebraType = typename Traits::DualLieAlgebraType + +template struct LieGroupBase { + using Traits = LieGroupTraits; + ALIGATOR_LIEGROUP_TRAITS_DEFINE(Traits); + + Derived &derived() { return static_cast(*this); } + + const Derived &derived() const { return static_cast(*this); } + + Derived &const_cast_derived() const { + return const_cast(derived()); + } +}; + +} // namespace aligator