The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.math.num-analysis

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: ZGESVD for highly ill-conditioned matrix
Replies: 2   Last Post: Sep 13, 2012 11:56 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2
Registered: 10/4/11
Re: ZGESVD for highly ill-conditioned matrix
Posted: Sep 13, 2012 10:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Sep 13, 4:23 am, Ganesh Diwan <> wrote:
> Hello,
> My apologies if the question sounds too trivial but I am new to LAPACK and can't figure out what's going wrong with the code. Ok, so here it goes.
> I need to solve for x in Ax = b system where the matrix A (about 100 x 100 size ) is square,( but could also be rectangular sometimes ), complex, dense, and highly ill-conditioned (condition number \kappa ~ 10E+017 ). The best way to solve such a system is obviously SVD.
> First I computed the SVD using Matlab, then obtained  the inverse of A to get solution vector x ( A-1b ) and that gives me the correct answer ( I am solving a problem for which theoretical solution is available).
> But when I tried to solve the same problem with ZGESVD, I get a wrong solution. Wrong decomposition? Obviously! Yes, the matrix entries for U and V from ZGESVD and MATLAB ([u,s,v] = svd(A)) are very different. Only a few entries from upper left corner of U and V match (that too only upto 4 or 5 deciamal places). Surprisingly, I get a very good comparison between ZGESVD and Matlab for singular vector S.
> When I test the ZGESVD code for a small matrix with a reasonable \kappa (~ 10E+001 ) ( a randomly generated matrix from Matlab ), the comparison is very good for U, V and S (the numbers match to double precision ).  I am not sure what goes wrong when I try this with a bigger and highly ill-conditioned complex matrix using ZGESVD.
> I checked for the correctness of the input that is given to ZGESVD (precision, sequence of arguments etc. ), everything looks OK. Not sure why I can?t get the correct SVD from ZGESVD when Matlab uses same routine for its SVD command.  Is there anything I am missing?

Some code? Let's see your Fortran.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.