Opened 9 years ago

Closed 9 years ago

#32 closed defect (fixed)

HLSVD 'failure to converge' goes undetected

Reported by: flip Owned by: flip
Priority: major Milestone:
Component: hlsvd Version:
Keywords: Cc: bsoher


The Fortran code on which our HLSVD is based is mostly unchanged from the original. However, we made one change which might have negative consequences.

The original version of the code wrote a few pieces of information to a file called We commented out the code that wrote to this file since we were getting everything we needed (we thought) back in the return parameters from the hlsvd() subroutine.

However, two values were written to that might be important, and our current version of the code just discards them. The caller never gets to see them.

The first value is from a variable is called ierr and it's set during the call to comlr(). Other than writing it to, the Fortran code makes no further mention of this variable. It's not tested or mentioned in the comments. My sense is that it's not very important.

The second variable we discard seems more important. It's the info variable returned by the call to zgelss(). Here's the comments in the Fortran code about info --

c     info   - integer, on exit:
c              = 0: successful exit :-)
c              < 0: for info = -j, the jth argument had an illegal value.
c              > 0: the algorithm for computing the svd failed to
c                   converge; if info = j, j off-diagonal elements of
c                   an intermediate bidiagonal form did not converge
c                   to zero :-(

So it seems that even when passed valid parameters, the SVD can fail, perhaps due to some shortcoming of the algorithm when applied to difficult data. Whatever the case may be, I think it's dangerous for us to discard this value. It's possible that all the results we're getting are paired with an unsuccessful return code from zgless(), indicating that the results are not trustworthy. How would we know?

I suggest that we change the Fortran code and the Python wrapper to return the zgless() info variable and perhaps the comlr() ierr variable to the caller.

Change History (1)

comment:1 Changed 9 years ago by flip

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r2644. Both the return codes from zgelss() and comlr() are now returned to the caller.

Note: See TracTickets for help on using tickets.