Skip to content

Draft: Feature/introduce retraction notion

Müller, Alexander requested to merge feature/introduceRetractionNotion into master

I propopes an implementation of introducing different retraction types for the manifolds. This relates to issue #2 (closed).

It is implemented as a template parameter of the corresponding manifold

Implementation details

  • The exp function is renamed at appropiate places to retr
  • retr forward to exp if the manifold has only the exponential map as retraction
  • Depending on the template parameter the different retraction types can be used at compile time
template <class T, int N, RetractionType RT=RetractionType::ExponentialMap>
class UnitVector
{

...

  static UnitVector retr(const UnitVector& p, const EmbeddedTangentVector& ev) {

    UnitVector result;
    if constexpr (RT==RetractionType::ExponentialMap)
      result= exp(p,ev);
    else
      result= closestPointProjection(p,ev);

    return result;
  }

Advantages

  • Changes are almost local
  • Global changes are only renaming exp to retr

Drawbacks

  • Changing retraction type during runtime ,e.g. between iterations not directly supported
  • templating the whole manifold class only for the retraction type seems overkill but templating the retr function alone would lead to more global changes

Thoughts about this? Is this kind of PR procdeure ok for you @osander ? or should the procedure be different?

Edited by Müller, Alexander

Merge request reports

Loading