Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 16 additions & 0 deletions include/aligator/core/lie-algebra.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/// @file
/// @copyright Copyright (C) 2025 INRIA
#pragma once

#include "aligator/fwd.hpp"

namespace aligator {

template <typename Derived> struct LieAlgebraTraits;

/// @brief Base CRTP for Lie algebras.
template <typename Derived> struct LieAlgebraBase {
using Traits = LieAlgebraTraits<Derived>;
};

} // namespace aligator
35 changes: 35 additions & 0 deletions include/aligator/core/lie-group-base.hpp
Original file line number Diff line number Diff line change
@@ -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 <typename Derived> 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 <typename Derived> struct LieGroupBase {
using Traits = LieGroupTraits<Derived>;
ALIGATOR_LIEGROUP_TRAITS_DEFINE(Traits);

Derived &derived() { return static_cast<Derived &>(*this); }

const Derived &derived() const { return static_cast<const Derived &>(*this); }

Derived &const_cast_derived() const {
return const_cast<Derived &>(derived());
}
};

} // namespace aligator
Loading