Skip to content

Add option to skip SO2 re-normalization#559

Open
DmitriyKorchemkin wants to merge 1 commit intostrasdat:mainfrom
DmitriyKorchemkin:skip-so2-normalization
Open

Add option to skip SO2 re-normalization#559
DmitriyKorchemkin wants to merge 1 commit intostrasdat:mainfrom
DmitriyKorchemkin:skip-so2-normalization

Conversation

@DmitriyKorchemkin
Copy link
Copy Markdown
Contributor

This patch adds control over re-normalization for SO2/SE2 groups.

Rationale

For short sequences of operations (5..10 group products) the norm of the unit complex number representing the group element typically does not drift significantly.
In those cases, re-normalization can be omitted, avoiding extra cost of square roots and divisions for basic group operations.

For my problem (closed-form steering control computations) switching to unnormalized group operations yields ~3..4x increase in speed.

Implemented behavior

Normalization behavior is controlled by PreserveInvariant flag of the type.

Default is to keep normalization (current behavior), except SO2::inverse() and SO2::exp():

  • inverse() only changes the sign of the imaginary part, thus the norm is preserved automatically
  • exp() skips normalization under assumption that sin and cos values are consistent with each other

Conversions between (un-)normalized types are possible via operator() and SO2(SO2Base<OtherDerived> const&) constructors.

Group operation always returns unnormalized product if either of factors is unnormalized.

Implementation in the main branch performed normalization twice in operator*:

I have added a switch that checks if norm is exactly 1,0 after series-based approximation, but this might need to be relaxed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant