itt-ustutt / num-dual

Generalized (hyper-) dual numbers in rust
Apache License 2.0
60 stars 7 forks source link

Switch to nalgebra for statically allocated vectors #52

Closed prehner closed 1 year ago

prehner commented 1 year ago

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

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

prehner commented 1 year ago

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