-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add nalgebra support #68
Add nalgebra support #68
Conversation
…nspose When using static matrices, it must be possible to specify the result type of transposing a non-square matrix. For example, transposing a `na::Matrix6x2` would result in a `na::Matrix2x6` matrix.
The example uses dynamic matrices instead of static ones because `ArgminOp` only allows specifying the type of Jacobian/Hessian but not their transposes. Although it's possible to add 2 extra associated types for the transposes, it would be a breaking change; it's better to wait for when associated type defaults are stable. Also, to get this working, the std::default::Default bound had to be removed from the solver's parameters because dynamic matrices in nalgebra don't implement it.
Wow! This is amazing, thank you for this massive contribution!
That's probably a general problem of this approach. I'm open to any ideas that may improve this situation. I'm not sure, but I think the CI is failing because I will try to give this a thorough review in the next couple of days. Thanks again! :) |
f406e2f
to
a851f02
Compare
a851f02
to
884d04e
Compare
@stefan-k You're more than welcome :) The CI is failing because I accidentally committed an example I was working on that (indeed) isn't compiling due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for your contribution! :)
This PR adds support for the
nalgebra
crate. This allows using static matrices withargmin
. It also means that operations that panicked before now result in a compilation error (e.g., multiplying incompatible static matrices).Not all math traits were implemented; only the ones that were implemented for
ndarray
are now implemented fornalgebra
. A usage example was also added for the Gauss-Newton solver.The implementations of
argmin
's math traits use a lof of generic code to support all the matrices provided bynalgebra
(both static and dynamic ones). However, the disadvantage is that any change innalgabra
's definitions of matrices or the functions they support will break the implementations inargmin
.NB: Thank you for providing and maintaining such a great optimization crate with support for many solvers. It saved us a lot of time :)