-
-
Notifications
You must be signed in to change notification settings - Fork 490
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
Complex number support #567
Conversation
This includes singular values, eigenvalues of hermitian matrices, tridiagonalization and bidiagonalization diagonal and off-diagonal elements.
Wow this is an enormous PR, I totally underestimated the magnitude of this change. Thank you for all this, it will definitely be a huge help in my project and surely many others! That being said, I have just a few questions. For many of these functions that now use Again, I really appreciate the open-source work that went into this project and it will definitely be useful no matter what! 😄 |
It would be interesting to see how well the optimizer copes with the increased abstraction, though. |
@Ralith Thank you, I see you're right, I did not realize there was a new trait because I was mixing it up with the |
I think everything's continuing to return the same type it's given as input, so e.g. if you want to get complex results for real inputs you'll have to lift your reals into a complex type with an explicit zero imaginary component first yourself. |
@Ralith What I mean is, if we now change the |
I think so.
For types that cannot represent the imaginary component, they'll probably do the same thing they do today. If you don't want that behavior, use a type that can represent the imaginary component. |
@Coder-256 I confirm what @Ralith said. Everything will work just like before for anything that are not complex numbers. If you use
If you have a function that takes a type
The square root of a negative real does not exist if you are not working on the complex field. So for this square root to exist, you need to provide a complex number (with an imaginary part equal to zero) in the first place. I understand having a trait named |
Name collisions between different numeric libraries are probably inevitable. I think (This would probably be a good thing to do with other traits that come from |
@sebcrozet IMHO naming the trait |
@Coder-256 Thank you for the suggestions, I think those are actually great names! |
|
# Conflicts: # src/base/ops.rs # src/geometry/isometry.rs # src/geometry/quaternion.rs # src/geometry/quaternion_construction.rs # src/geometry/rotation.rs # src/geometry/similarity.rs # src/geometry/transform.rs # src/geometry/translation.rs # src/geometry/unit_complex.rs
…enchmarks. We are forced to remove the dependency because of the Cargo bug rust-lang/cargo#4866 that would break compilation for #[no-std]. In practice, this means benchmarks will not compile any more unless we manually uncomment the criterion dependency.
U go gurl!!! |
This adds complex number support almost everywhere a
Real
was accepted before. This includes decomposition of complex matrices as well as BLAS operations involving conjugate-transposition.This relies on ongoing work on the alga crate on the complex branch.
Fix #281
Fix #503