This is a common problem with big matrices; I use maxit = 1000. It is
strange that the linpack SVD code has a fixed upper bound on the number of
iterations since that limits the size of the matrices that can be used. It
would probably be safe to remove the limit altogether.
In any case, if your matrix is symmetric you are probably better off using
a symmetric eigendecomposition but the relevant netlib code (TQL2) also
has a maximum of 30 iterations.
The MATLAB SVD code is faster and better, presumably since they continue
to develop it and fit it when they find problems, whereas DSVDC was
written in 1978 and seems to have been last modified in 1984.
On Wed, 20 Nov 2002, Brendan McCane wrote:
> G'day,
>
> I've just come across an interesting problem which I thought someone
> might be interested in. I have been trying to calculate the inverse of a
> 625x625 covariance matrix (ie real and symmetric) via vnl_svd. But I
> kept getting errors from the netlib code vnl_linpack_svdc. The variable
> info was nonzero on return (624 in fact) and the return matrix was
> definitely not an inverse. I suspected it might be the compiler I was
> using (gcc version 3.0.4 (Red Hat Linux 7.2 3.0.41)  on a Pentium III)
> so I recompiled netlib with optimisation off and ffloatstore as
> suggested in vnl_svd.txx. This made no difference. As a last resort, I
> increased the number of iterations in dsvdc.c from maxit=30 to maxit=100
> and the inverses now work! No reason for choosing a 100, it was just a
> nice round number. Anyway, matlab had no problems calculating the
> inverses or the svd, so I knew it was in the code somewhere.
>
> Anyway, I don't know whether something should be done about this or not.
> I don't know why maxit=30 was originally chosen, nor if it's a good
> number in general, so I can't really comment on whether it should be
> increased. I just thought everyone should be informed.
