0

I'm considering to learn Scala for my algorithm development, but first need to know if the language has implemented (or is implementing) complex inverse and pseudo-inverse functions. I looked at the documentation (here, here), and although it states these functions are for real matrices, in the code, I don't see why it wouldn't accept complex matrices.

There's also the following comment left in the code:

pinv for anything that can be transposed, multiplied with that transposed, and then solved

Is this just my wishful thinking, or will it not accept complex matrices?

zanbri
  • 5,958
  • 2
  • 31
  • 41
  • you can use java library, for example apache commons math, can not you? – vvg Dec 09 '15 at 16:36
  • @Mr.V. apache commons doesn't have complex solve or any complex matrix decompositions, as best I know. – dlwh Dec 09 '15 at 17:55

1 Answers1

1

Breeze implementer here:

I haven't implemented inv etc. for complex numbers yet, because I haven't figured out a good way to store complex numbers unboxed in a way that is compatible with blas and lapack and doesn't break the current API. You can set the call up yourself using netlib java following a similar recipe to the code you linked.

dlwh
  • 2,257
  • 11
  • 23
  • Thanks for your answer. Seeing as though it won't be for another couple of months before I'll be at the level to implement it myself (probably poorly as I'd be new to functional programming), could I ask if it's on a roadmap to be developed? Particularly the pseudo-inverse case? – zanbri Dec 10 '15 at 00:27
  • That presumes the existence of a roadmap. I add things as I need (or want) them or if they're on the github issues list (though I definitely don't get to everything on that!). – dlwh Dec 10 '15 at 03:20
  • getting a boxed implementation working wouldn't be hard at all, really. I'm just kind of picky and probably won't work on Complex until I have a satisfactory answer for getting rid of boxing. – dlwh Dec 10 '15 at 03:22
  • haha I appreciate your candor :) That's good enough of a reason to go with Scala then! I'm really looking forward to learning its functional o-o approach... thanks again – zanbri Dec 10 '15 at 03:46
  • 1
    well, you got me thinking about it again, and I might have a solution... It requires some pretty major changes, but we'll see. – dlwh Dec 10 '15 at 05:42