svd on "big" matrix


Nicolas
08-28-2003, 03:12 AM
Hello

I have a problem with svdcmp. I'm using it to get the expansion of Toeplitz matrix with elements exp(-|i-j|*sigma^2 /2), where sigma=0.02.
When I used it on matrix of size approximatively 504, it worked fine. But when I tried to use it on matrix of size 4000 (with the elements always defined as above), the following message appeared after several hours of calculation :
ERROR - No convergence in 30 svdcmp iterations.
Though the coefficients of the size 4000 matrix do not exceed the limitations : coefficients of the matrix are between 1 and 0.4 ; after Matlab calculation (which works), U coefficients are lower bounded by 2.6769e-010 and W coefficients are lower bounded by approx 1.e-4.
Is there a limit matrix size for this program?
If anyone can help me please do.

Thanks,

Nicolas

kibitzer
08-29-2003, 10:53 AM
Hi Nicolas,

Are you running in double precision? The C++ version of NR is double precision by default, but for C or Fortran you can convert as described in the books. I ran your example successfully with v2.11 of C++ (it took several hours).

Nicolas
08-29-2003, 11:05 AM
Hello

I use the numerical recipes in C, I copied the svdcmp from the CD and I have modified the routine so that it uses "double" instead of "float" everywhere.
I'll double check-it.
The simulations I run lasted a few hours before giving the error message.
Thanks for your answer,

Nicolas

Nicolas
09-12-2003, 08:47 AM
I've tested the svdcmp function using the xsvdcmp.c given in the NR CD, then modifying it. It works until lengths 3000x3000, and then seems to give the error message for all greater lengths...
There is something that does not converge during the 30 iterations but I don't understand what.
The matrix always has elements exp(-|i-j|*0.002).