Skip to content

Switch to nalgebra for statically allocated vectors #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 24, 2023
Merged

Conversation

prehner
Copy link
Contributor

@prehner prehner commented Jan 29, 2023

The StaticMat struct was always meant as a placeholder until a more performant alternative is available.

nalgebra provides statically allocated vectors and matrices. It is well maintained, more feature complete, and more performant.

As a consequence the derive api is not possible for vectors anymore. In this PR it is replaced with more explicit functions for, e.g., gradients, Hessians and Jacobians. Of course, it is still possible to construct dual numbers from their real and dual parts.

Some disadvantages

  • The dependency tree is exploding and compile times are up.
  • the string representation of dual numbers is a bit wonky (maybe override it by hand?).
  • Due to the somewhat stringent trait bounds in nalgebra, the trait bounds in num-dual also have to be tightened. This has no effect on applications of dual numbers.

Overall, this should be an advantage with regard to the maintainability, though.

@prehner prehner marked this pull request as ready for review February 12, 2023 12:37
@prehner prehner requested a review from g-bauer February 12, 2023 12:38
@prehner
Copy link
Contributor Author

prehner commented Feb 24, 2023

With the considerations in #53 the derive methods are renamed to derivative. They are now only available for scalar dual numbers.

@prehner prehner merged commit e3c7c41 into master Feb 24, 2023
@prehner prehner deleted the nalgebra branch February 24, 2023 11:22
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.

2 participants