Skip to content
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

Compatibility of 'DualNum' trait with nalgebra #55

Closed
prehner opened this issue Feb 23, 2023 · 2 comments · Fixed by #65
Closed

Compatibility of 'DualNum' trait with nalgebra #55

prehner opened this issue Feb 23, 2023 · 2 comments · Fixed by #65
Milestone

Comments

@prehner
Copy link
Contributor

prehner commented Feb 23, 2023

By implementing nalgebra::ComplexField for dual numbers (analogous to the implementation for f64) the full linear algebra capabilities of nalgebra (in particular eigenvalues) can be used with arbitrary generalized (hyper-) dual numbers. Currently this is only possible with first order dual numbers.

In this context it is worth reconsidering whether the Float trait should also be part of the supertraits of DualNum.

If this is implemented, the linalg module can be discarded in favor of the well established functionalities in nalgebra.

@prehner
Copy link
Contributor Author

prehner commented Apr 3, 2023

The required traits for using the eigenvalue function in nalgebra are so unfathomably restrictive (e.g., including SimdValue) that it is unlikely that they will ever be implemented for structs other than f32 and f64. Therefore, it is unlikely that we can completely get rid of the eigenvalue algorithm in num-dual.

@prehner
Copy link
Contributor Author

prehner commented May 7, 2023

#59 actually does implement the necessary trait bounds that calculations like

    let a = Dual64::from(1.0).derivative();
    let b = Dual64::from(2.0);
    let c = Dual64::from(4.0);
    let m = Matrix2::from_row_slice(&[a, b, b, c]);
    let v = SymmetricEigen::new(m).eigenvalues;

are now possible. Therefore the linalg module and feature should be abandoned in favor of nalgebras tried and tested implementations.

@prehner prehner added this to the v0.7.0 milestone May 8, 2023
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 a pull request may close this issue.

1 participant