Complex matrices and svdcmp
Hi,
I'm trying to modify the Fortran 90 version of svdcmp
so that it can handle complex matrices. However,
there are some commands that are not well-defined
(and may be multiply-valued) mathematically for
complex numbers/matrices like for example the
SIGN() and the SQRT() functions. Right now I'm
studying the algorithm (from another book by Golub
and Van Loan) to see why such commands are
necessary. Has anybody also tried this? How
did you modify the code?
Thanks in advance,
Eduardo
Bill Press
11-08-2002, 02:57 PM
Hi, Eduardo!
You might want to look at Lapack, which is freely available and which has SVD routines for complex matrices.
A place to start is at
http://www.netlib.org/lapack/lug/node53.html
Good luck!
Bill P.
Hi Bill,
Thanks for the quick reply. Yes, I did try LAPACK. For real matrices, it works as advertised. Unfortunately, it doesn't work
properly when dealing with complex matrices. I'm trying to communicate with the LAPACK authors about this. LAPACK also sorts the singular values (in descending order) on output. This is something that I don't want to happen because I'm using the SVD decomposed matrix to solve a (can be singular) linear problem. But determining the right order of the singular values can be done by multplying U(transpose) and V to A so this is not a bad problem (although it would've been computationally economical for this particular case if the singular values maintained their order).
In any case, I'm trying all avenues right now. It would be great if you could give me some pointers on how to modify svdcmp to accomodate complex matrices.
Thanks,
Eduardo
Bill Press
11-08-2002, 08:24 PM
Hi, Eduardo.
There really is no natural order for the singular values -- you can get any order you want by permuting rows/columns of U/V. So it is only a convention to sort by the magnitude of the singular values. It should not interfere with your solving a linear system.
Linpack is pretty thoroughly tested, so I think you should consider the possibility that you are not using it in the intended manner. Just a thought...
Good luck!
Bill P.
Hi Bill,
Thank you for the healthy skepticism. After more than a weekend of wrangling with my codes, I finally found the bug that makes LAPACK produce the wrong answers. Indeed, nothing's wrong with the complex version of LAPACK's SVD subroutine.
Thanks,
Eduardo
narciso
08-22-2003, 06:29 AM
so, eduardo, i guess if now you have an algorithm for complex svd, and if you could please contact me at my email: ag@kom.auc.dk
thanks