smooth
A C++ library for Lie theory
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Static Protected Attributes | List of all members
LieGroupBase< Derived > Class Template Reference

Base class for Lie group types. More...

#include <lie_group_base.hpp>

Inheritance diagram for LieGroupBase< Derived >:
Inheritance graph
[legend]

Public Types

using Scalar = typename traits::Scalar
 Scalar type.
 
using Matrix = Eigen::Matrix< Scalar, Dim, Dim >
 Lie group matrix type.
 
using Tangent = Eigen::Matrix< Scalar, Dof, 1 >
 Lie group parameterized tangent type.
 
using TangentMap = Eigen::Matrix< Scalar, Dof, Dof >
 Matrix representing map between tangent elements.
 
using Hessian = Eigen::Matrix< Scalar, Dof, Dof *Dof >
 Plain return type with different scalar.
 
template<typename NewScalar >
using CastT = typename traits::template PlainObject< NewScalar >
 Plain return type with different scalar.
 
using PlainObject = CastT< Scalar >
 Plain return type.
 

Public Member Functions

template<bool = true>
requires (is_mutable)
autocoeffs () const
 Access underlying storages.
 
const autocoeffs () const
 Const access underlying storages.
 
template<bool = true>
requires (is_mutable)
autodata () const
 Access raw pointer.
 
const autodata () const
 Const access raw pointer.
 
template<typename OtherDerived >
requires (is_mutable && std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
Derivedoperator= (const LieGroupBase< OtherDerived > &o) noexcept
 
Eigen::Index dof () const noexcept
 Dynamic size (degrees of freedom).
 
void setIdentity () noexcept
 Set to group identity element.
 
void setRandom () noexcept
 Set to a random element.
 
Matrix matrix () const noexcept
 Return as matrix Lie group element in \( \mathbb{R}^{\mathtt{dim} \times \mathtt{dim}} \).
 
template<typename OtherDerived >
requires (std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
bool isApprox (const LieGroupBase< OtherDerived > &o, const Scalar &eps=Eigen::NumTraits< Scalar >::dummy_precision()) const noexcept
 Check if (approximately) equal to other element o.
 
template<typename NewScalar >
CastT< NewScalarcast () const noexcept
 Cast to different scalar type.
 
template<typename OtherDerived >
requires (std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
PlainObject operator* (const LieGroupBase< OtherDerived > &o) const noexcept
 Group binary composition operation.
 
template<typename OtherDerived >
requires (is_mutable && std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
Derivedoperator*= (const LieGroupBase< OtherDerived > &o) noexcept
 Inplace group binary composition operation.
 
PlainObject inverse () const noexcept
 Group inverse operation.
 
Tangent log () const noexcept
 Lie group logarithm.
 
TangentMap Ad () const noexcept
 Lie group adjoint.
 
template<typename TangentDerived >
PlainObject operator+ (const Eigen::MatrixBase< TangentDerived > &a) const noexcept
 Right-plus.
 
template<typename TangentDerived >
requires (is_mutable)
Derivedoperator+= (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Inplace right-plus: \( \mathbf{x} \leftarrow \mathbf{x} \circ \exp(\mathbf{a}) \).
 
template<typename OtherDerived >
requires (std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
Tangent operator- (const LieGroupBase< OtherDerived > &xo) const noexcept
 Right-minus.
 

Static Public Member Functions

static PlainObject Identity () noexcept
 Construct the identity element.
 
static PlainObject Random () noexcept
 Construct a random element.
 
template<typename TangentDerived >
static PlainObject exp (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Lie group exponential map.
 
template<typename TangentDerived >
static Matrix hat (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Lie algebra hat map.
 
template<typename MatrixDerived >
static Tangent vee (const Eigen::MatrixBase< MatrixDerived > &A) noexcept
 Lie alebra vee map.
 
template<typename TangentDerived >
static TangentMap ad (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Lie algebra adjoint.
 
template<typename TangentDerived1 , typename TangentDerived2 >
static Tangent lie_bracket (const Eigen::MatrixBase< TangentDerived1 > &a, const Eigen::MatrixBase< TangentDerived2 > &b) noexcept
 Lie algebra bracket.
 
template<typename TangentDerived >
static TangentMap dr_exp (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Right jacobian of the exponential map.
 
template<typename TangentDerived >
static TangentMap dr_expinv (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Inverse of right jacobian of the exponential map.
 
template<typename TangentDerived >
static TangentMap dl_exp (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Left jacobian of the exponential map.
 
template<typename TangentDerived >
static TangentMap dl_expinv (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Inverse of left jacobian of the exponential map.
 
template<typename TangentDerived >
static Hessian d2r_exp (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Right Hessian of the exponential map.
 
template<typename TangentDerived >
static Hessian d2r_expinv (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Right Hessian of the log map.
 
template<typename TangentDerived >
static Hessian d2l_exp (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Left Hessian of the exponential map.
 
template<typename TangentDerived >
static Hessian d2l_expinv (const Eigen::MatrixBase< TangentDerived > &a) noexcept
 Left Hessian of the log map.
 

Static Public Attributes

static constexpr int RepSize = Impl::RepSize
 Number of scalars in internal representation.
 
static constexpr int Dof = Impl::Dof
 Degrees of freedom of manifold (equal to tangent space dimension).
 
static constexpr int Dim = Impl::Dim
 Side of Lie group matrix representation.
 
static constexpr bool IsCommutative = Impl::IsCommutative
 Commutativity of group. A commutative group has a zero Lie bracket.
 

Protected Types

using traits = liebase_info< Derived >
 CRTP traits.
 
using Impl = typename traits::Impl
 Group-specific Lie group implementation.
 

Static Protected Attributes

static constexpr bool is_mutable = traits::is_mutable
 True if underlying storage supports modification.
 

Detailed Description

template<typename Derived>
class LieGroupBase< Derived >

Base class for Lie group types.

Definition at line 27 of file lie_group_base.hpp.

Member Typedef Documentation

◆ CastT

Plain return type with different scalar.

Definition at line 67 of file lie_group_base.hpp.

◆ Hessian

template<typename Derived >
using LieGroupBase< Derived >::Hessian = Eigen::Matrix<Scalar, Dof, Dof * Dof>

Plain return type with different scalar.

Definition at line 64 of file lie_group_base.hpp.

◆ Impl

template<typename Derived >
using LieGroupBase< Derived >::Impl = typename traits::Impl
protected

Group-specific Lie group implementation.

Definition at line 40 of file lie_group_base.hpp.

◆ Matrix

template<typename Derived >
using LieGroupBase< Derived >::Matrix = Eigen::Matrix<Scalar, Dim, Dim>

Lie group matrix type.

Definition at line 58 of file lie_group_base.hpp.

◆ PlainObject

Plain return type.

Definition at line 69 of file lie_group_base.hpp.

◆ Scalar

template<typename Derived >
using LieGroupBase< Derived >::Scalar = typename traits::Scalar

Scalar type.

Definition at line 56 of file lie_group_base.hpp.

◆ Tangent

template<typename Derived >
using LieGroupBase< Derived >::Tangent = Eigen::Matrix<Scalar, Dof, 1>

Lie group parameterized tangent type.

Definition at line 60 of file lie_group_base.hpp.

◆ TangentMap

template<typename Derived >
using LieGroupBase< Derived >::TangentMap = Eigen::Matrix<Scalar, Dof, Dof>

Matrix representing map between tangent elements.

Definition at line 62 of file lie_group_base.hpp.

◆ traits

template<typename Derived >
using LieGroupBase< Derived >::traits = liebase_info<Derived>
protected

CRTP traits.

Definition at line 37 of file lie_group_base.hpp.

Member Function Documentation

◆ Ad()

template<typename Derived >
TangentMap LieGroupBase< Derived >::Ad ( ) const
inlinenoexcept

Lie group adjoint.

Returns
Matrix \( \mathbf{Ad}_\mathbf{X} \) s.t. \( \mathbf{Ad_X} \mathbf{a} = ( \mathbf{X} \mathbf{a}^\wedge \mathbf{X}^{-1} )^\vee \)

Definition at line 227 of file lie_group_base.hpp.

◆ ad()

template<typename Derived >
static TangentMap LieGroupBase< Derived >::ad ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Lie algebra adjoint.

Returns
Matrix \( \mathbf{ad}_\mathbf{a} \) s.t. \( \mathbf{ad}_\mathbf{a} \mathbf{b} = [\mathbf{a}, \mathbf{b}] \)

Definition at line 332 of file lie_group_base.hpp.

◆ cast()

template<typename Derived >
template<typename NewScalar >
CastT< NewScalar > LieGroupBase< Derived >::cast ( ) const
inlinenoexcept

Cast to different scalar type.

Definition at line 169 of file lie_group_base.hpp.

◆ coeffs() [1/2]

template<typename Derived >
template<bool = true>
requires (is_mutable)
auto & LieGroupBase< Derived >::coeffs ( ) const
inline

Access underlying storages.

Definition at line 74 of file lie_group_base.hpp.

◆ coeffs() [2/2]

template<typename Derived >
const auto & LieGroupBase< Derived >::coeffs ( ) const
inline

Const access underlying storages.

Definition at line 79 of file lie_group_base.hpp.

◆ d2l_exp()

template<typename Derived >
static Hessian LieGroupBase< Derived >::d2l_exp ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Left Hessian of the exponential map.

Returns
\( \mathrm{d}^{2l} \exp_{aa} \) on horizontally stacked Hessian form.

Definition at line 458 of file lie_group_base.hpp.

◆ d2l_expinv()

template<typename Derived >
static Hessian LieGroupBase< Derived >::d2l_expinv ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Left Hessian of the log map.

Returns
\( \left( \mathrm{d}^l \left( \mathrm{d}^l \exp_a \right)^{-1} \right)_a \) on horizontally stacked Hessian form.

Definition at line 470 of file lie_group_base.hpp.

◆ d2r_exp()

template<typename Derived >
static Hessian LieGroupBase< Derived >::d2r_exp ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Right Hessian of the exponential map.

Returns
\( \mathrm{d}^{2r} \exp_{aa} \) on Horizontally stacked Hessian form.

Definition at line 423 of file lie_group_base.hpp.

◆ d2r_expinv()

template<typename Derived >
static Hessian LieGroupBase< Derived >::d2r_expinv ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Right Hessian of the log map.

Returns
\( \left( \mathrm{d}^r \left( \mathrm{d}^r \exp_a \right)^{-1} \right)_a \) on horizontally stakced Hessian form.

Definition at line 441 of file lie_group_base.hpp.

◆ data() [1/2]

template<typename Derived >
template<bool = true>
requires (is_mutable)
auto * LieGroupBase< Derived >::data ( ) const
inline

Access raw pointer.

Definition at line 84 of file lie_group_base.hpp.

◆ data() [2/2]

template<typename Derived >
const auto * LieGroupBase< Derived >::data ( ) const
inline

Const access raw pointer.

Definition at line 89 of file lie_group_base.hpp.

◆ dl_exp()

template<typename Derived >
static TangentMap LieGroupBase< Derived >::dl_exp ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Left jacobian of the exponential map.

Returns
\( \mathrm{d}^l \exp_a \)

Definition at line 401 of file lie_group_base.hpp.

◆ dl_expinv()

template<typename Derived >
static TangentMap LieGroupBase< Derived >::dl_expinv ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Inverse of left jacobian of the exponential map.

Returns
\( \left( \mathrm{d}^l \exp_a \right)^{-1} \)

Definition at line 412 of file lie_group_base.hpp.

◆ dof()

template<typename Derived >
Eigen::Index LieGroupBase< Derived >::dof ( ) const
inlinenoexcept

Dynamic size (degrees of freedom).

Definition at line 107 of file lie_group_base.hpp.

◆ dr_exp()

template<typename Derived >
static TangentMap LieGroupBase< Derived >::dr_exp ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Right jacobian of the exponential map.

Returns
\( \mathrm{d}^r \exp_a \)

Definition at line 367 of file lie_group_base.hpp.

◆ dr_expinv()

template<typename Derived >
static TangentMap LieGroupBase< Derived >::dr_expinv ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Inverse of right jacobian of the exponential map.

Returns
\( \left( \mathrm{d}^r \exp_a \right)^{-1} \)

Definition at line 384 of file lie_group_base.hpp.

◆ exp()

template<typename Derived >
static PlainObject LieGroupBase< Derived >::exp ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Lie group exponential map.

Definition at line 285 of file lie_group_base.hpp.

◆ hat()

template<typename Derived >
static Matrix LieGroupBase< Derived >::hat ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinestaticnoexcept

Lie algebra hat map.

Maps a parameterization \( a \in \mathbb{R}^\mathtt{dof} \) a matrix Lie algebra element to the corresponding matrix Lie algebra element \( A \in \mathbb{R}^{\mathtt{dim} \times \mathtt{dim}} \).

See also
vee for the inverse of hat

Definition at line 302 of file lie_group_base.hpp.

◆ Identity()

template<typename Derived >
static PlainObject LieGroupBase< Derived >::Identity ( )
inlinestaticnoexcept

Construct the identity element.

Definition at line 124 of file lie_group_base.hpp.

◆ inverse()

template<typename Derived >
PlainObject LieGroupBase< Derived >::inverse ( ) const
inlinenoexcept

Group inverse operation.

Definition at line 202 of file lie_group_base.hpp.

◆ isApprox()

template<typename Derived >
template<typename OtherDerived >
requires (std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
bool LieGroupBase< Derived >::isApprox ( const LieGroupBase< OtherDerived > &  o,
const Scalar eps = Eigen::NumTraits<Scalar>::dummy_precision() 
) const
inlinenoexcept

Check if (approximately) equal to other element o.

Definition at line 159 of file lie_group_base.hpp.

◆ lie_bracket()

template<typename Derived >
static Tangent LieGroupBase< Derived >::lie_bracket ( const Eigen::MatrixBase< TangentDerived1 > &  a,
const Eigen::MatrixBase< TangentDerived2 > &  b 
)
inlinestaticnoexcept

Lie algebra bracket.

\[ [ \mathbf{a}, \mathbf{b}] = \left( \mathbf{a}^\wedge \mathbf{b}^\wedge - \mathbf{b}^\wedge \mathbf{a}^\wedge \right)^\vee. \]

Definition at line 352 of file lie_group_base.hpp.

◆ log()

template<typename Derived >
Tangent LieGroupBase< Derived >::log ( ) const
inlinenoexcept

Lie group logarithm.

Returns
tangent logarithm element.

Definition at line 214 of file lie_group_base.hpp.

◆ matrix()

template<typename Derived >
Matrix LieGroupBase< Derived >::matrix ( ) const
inlinenoexcept

Return as matrix Lie group element in \( \mathbb{R}^{\mathtt{dim} \times \mathtt{dim}} \).

Definition at line 147 of file lie_group_base.hpp.

◆ operator*()

template<typename Derived >
template<typename OtherDerived >
requires (std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
PlainObject LieGroupBase< Derived >::operator* ( const LieGroupBase< OtherDerived > &  o) const
inlinenoexcept

Group binary composition operation.

Definition at line 181 of file lie_group_base.hpp.

◆ operator*=()

template<typename Derived >
template<typename OtherDerived >
requires (is_mutable && std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
Derived & LieGroupBase< Derived >::operator*= ( const LieGroupBase< OtherDerived > &  o)
inlinenoexcept

Inplace group binary composition operation.

Definition at line 193 of file lie_group_base.hpp.

◆ operator+()

template<typename Derived >
PlainObject LieGroupBase< Derived >::operator+ ( const Eigen::MatrixBase< TangentDerived > &  a) const
inlinenoexcept

Right-plus.

Returns
\( \mathbf{x} \oplus \mathbf{a} = \mathbf{x} \circ \exp(\mathbf{a}) \)

Definition at line 244 of file lie_group_base.hpp.

◆ operator+=()

template<typename Derived >
template<typename TangentDerived >
requires (is_mutable)
Derived & LieGroupBase< Derived >::operator+= ( const Eigen::MatrixBase< TangentDerived > &  a)
inlinenoexcept

Inplace right-plus: \( \mathbf{x} \leftarrow \mathbf{x} \circ \exp(\mathbf{a}) \).

Returns
Reference to this

Definition at line 256 of file lie_group_base.hpp.

◆ operator-()

template<typename Derived >
template<typename OtherDerived >
requires (std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
Tangent LieGroupBase< Derived >::operator- ( const LieGroupBase< OtherDerived > &  xo) const
inlinenoexcept

Right-minus.

Returns
Tangent space element \( \mathbf{a} \) such that \( \mathbf{this} = \mathbf{xo} \oplus \mathbf{a} \).

\[ \mathbf{x}_1 \ominus \mathbf{x}_2 := \log(\mathbf{x}_2^{-1} \circ \mathbf{x}_1) \]

Definition at line 274 of file lie_group_base.hpp.

◆ operator=()

template<typename Derived >
template<typename OtherDerived >
requires (is_mutable && std::is_same_v<Impl, typename liebase_info<OtherDerived>::Impl>)
Derived & LieGroupBase< Derived >::operator= ( const LieGroupBase< OtherDerived > &  o)
inlinenoexcept

Assignment operation from other storage type.

Definition at line 96 of file lie_group_base.hpp.

◆ Random()

template<typename Derived >
static PlainObject LieGroupBase< Derived >::Random ( )
inlinestaticnoexcept

Construct a random element.

Set the seed with std::srand(unsigned).

Definition at line 136 of file lie_group_base.hpp.

◆ setIdentity()

template<typename Derived >
void LieGroupBase< Derived >::setIdentity ( )
inlinenoexcept

Set to group identity element.

Definition at line 112 of file lie_group_base.hpp.

◆ setRandom()

template<typename Derived >
void LieGroupBase< Derived >::setRandom ( )
inlinenoexcept

Set to a random element.

Set the seed with std::srand(unsigned).

Definition at line 119 of file lie_group_base.hpp.

◆ vee()

template<typename Derived >
template<typename MatrixDerived >
static Tangent LieGroupBase< Derived >::vee ( const Eigen::MatrixBase< MatrixDerived > &  A)
inlinestaticnoexcept

Lie alebra vee map.

Maps a matrix Lie algebra element \( A \in \mathbb{R}^{\texttt{dim} \times \mathtt{dim}} \) to the corresponding parameterization \( a \in \mathbb{R}^\mathtt{dof} \).

See also
hat for the inverse of vee

Definition at line 318 of file lie_group_base.hpp.

Member Data Documentation

◆ Dim

template<typename Derived >
constexpr int LieGroupBase< Derived >::Dim = Impl::Dim
staticconstexpr

Side of Lie group matrix representation.

Definition at line 51 of file lie_group_base.hpp.

◆ Dof

template<typename Derived >
constexpr int LieGroupBase< Derived >::Dof = Impl::Dof
staticconstexpr

Degrees of freedom of manifold (equal to tangent space dimension).

Definition at line 49 of file lie_group_base.hpp.

◆ is_mutable

template<typename Derived >
constexpr bool LieGroupBase< Derived >::is_mutable = traits::is_mutable
staticconstexprprotected

True if underlying storage supports modification.

Definition at line 43 of file lie_group_base.hpp.

◆ IsCommutative

template<typename Derived >
constexpr bool LieGroupBase< Derived >::IsCommutative = Impl::IsCommutative
staticconstexpr

Commutativity of group. A commutative group has a zero Lie bracket.

Definition at line 53 of file lie_group_base.hpp.

◆ RepSize

template<typename Derived >
constexpr int LieGroupBase< Derived >::RepSize = Impl::RepSize
staticconstexpr

Number of scalars in internal representation.

Definition at line 47 of file lie_group_base.hpp.


The documentation for this class was generated from the following file: