DlangScience / scid

Scientific library for the D programming language
Boost Software License 1.0
90 stars 31 forks source link

Allow for inverting a complex matrix #51

Open mmtrebuchet opened 8 years ago

mmtrebuchet commented 8 years ago

I see that invert is "Currently only defined for general real matrices". I don't have a good linear algebra intuition, and I can't see why the invert() function in linalg.d isn't capable of handling complex arguments. Everything I've seen suggests that ZGETRF and ZGETRI should invert a complex matrix. Is there something I'm missing?

kyllingstad commented 8 years ago

To be honest, I don't know. I would guess that I had some reason to put the !scid.core.traits.isComplex!T constraint on the function at the time, but it's so many years ago that I don't remember anymore. And I agree, at a quick glance it does seem like it should work with complex types. If you confirm that this is the case, a pull request (with a unittest) that removes the comment and the constraint would be much appreciated!