[Numpy-discussion] SVD error in Numpy. NumPy Update reversed?

Zachary Pincus zachary.pincus@yale....
Mon Mar 24 10:26:55 CDT 2008

Hi all,

> I looked at line 21902  of dlapack_lite.c, it is,
>        for (niter = iter; niter <= 20; ++niter) {
> Indeed the upper limit for iterations in the
> linalg.svd code is set for 20.  For now I will go with
> my method (on earlier post) of squaring the matrix and
> then doing svd when the original try on the original
> matrix throws the linalg.linalg.LinAlgError.  I do not
> claim that this is a cure-all.  But it seems to work
> fast and avoids the original code from thrashing
> around in a long iteration.
> I would suggest this be made explicit in the NumPy
> documentation and then the user be given the option to
> reset the limit on the number of iterations.
> Well, it certainly shouldn't be hardwired in as 20. At minimum it  
> should be a #define, and ideally it should be passed in with the  
> function call, but I don't know if the interface allows that.

I just wanted to mention that this particular issue has bitten me in  
the past too. It would be nice to be able to have a bit more control  
over the SVD iteration limit either at compile-time, or run-time.


More information about the Numpy-discussion mailing list