This fixes bugs 032 and 056.
Edits in cstein.f, dstein.f, sstein.f and zstein.f
From Osni on Monday, May 4:
As we discussed in our last conference call, I am attaching a new version of
_STEIN, which fixes bugs 032 and 056. (The bugs were reported for DSTEIN, but
I have propagated the fix to the other versions.) Also, in the process of
testing the fix for those two bugs with more difficult cases, we stumbled upon
a matrix that led SSTEIN to return NaNs in the eigenvectors ... We fixed that
too and, in summary, these are the changes in _STEIN:
1) The assignment after the GO TO 60 needs to be GPIND = J1 (instead of GPIND =
B1).
2) In 'Normalize and scale the righthand side vector Pb' (after GO TO 100 or GO
TO 120) we have replaced _ASUM with I_AMAX.
BLKSIZ = BN - B1 + 1
IF( BLKSIZ.EQ.1 )
$ GO TO 60
- GPIND = B1
+ GPIND = J1
*
* Compute reorthogonalization criterion and stopping criterion.
*
*
* Normalize and scale the righthand side vector Pb.
*
+ JMAX = ISAMAX( BLKSIZ, WORK( INDRV1+1 ), 1 )
SCL = BLKSIZ*ONENRM*MAX( EPS,
$ ABS( WORK( INDRV4+BLKSIZ ) ) ) /
- $ SASUM( BLKSIZ, WORK( INDRV1+1 ), 1 )
+ $ ABS( WORK( INDRV1+JMAX ) )
CALL SSCAL( BLKSIZ, SCL, WORK( INDRV1+1 ), 1 )
*
* Solve the system LU = Pb.
BLKSIZ = BN - B1 + 1
IF( BLKSIZ.EQ.1 )
$ GO TO 60
- GPIND = B1
+ GPIND = J1
*
* Compute reorthogonalization criterion and stopping criterion.
*
*
* Normalize and scale the righthand side vector Pb.
*
+ JMAX = IDAMAX( BLKSIZ, WORK( INDRV1+1 ), 1 )
SCL = BLKSIZ*ONENRM*MAX( EPS,
$ ABS( WORK( INDRV4+BLKSIZ ) ) ) /
- $ DASUM( BLKSIZ, WORK( INDRV1+1 ), 1 )
+ $ ABS( WORK( INDRV1+JMAX ) )
CALL DSCAL( BLKSIZ, SCL, WORK( INDRV1+1 ), 1 )
*
* Solve the system LU = Pb.
BLKSIZ = BN - B1 + 1
IF( BLKSIZ.EQ.1 )
$ GO TO 60
- GPIND = B1
+ GPIND = J1
*
* Compute reorthogonalization criterion and stopping criterion.
*
*
* Normalize and scale the righthand side vector Pb.
*
+ JMAX = ISAMAX( BLKSIZ, WORK( INDRV1+1 ), 1 )
SCL = BLKSIZ*ONENRM*MAX( EPS,
$ ABS( WORK( INDRV4+BLKSIZ ) ) ) /
- $ SASUM( BLKSIZ, WORK( INDRV1+1 ), 1 )
+ $ ABS( WORK( INDRV1+JMAX ) )
CALL SSCAL( BLKSIZ, SCL, WORK( INDRV1+1 ), 1 )
*
* Solve the system LU = Pb.
BLKSIZ = BN - B1 + 1
IF( BLKSIZ.EQ.1 )
$ GO TO 60
- GPIND = B1
+ GPIND = J1
*
* Compute reorthogonalization criterion and stopping criterion.
*
*
* Normalize and scale the righthand side vector Pb.
*
+ JMAX = IDAMAX( BLKSIZ, WORK( INDRV1+1 ), 1 )
SCL = BLKSIZ*ONENRM*MAX( EPS,
$ ABS( WORK( INDRV4+BLKSIZ ) ) ) /
- $ DASUM( BLKSIZ, WORK( INDRV1+1 ), 1 )
+ $ ABS( WORK( INDRV1+JMAX ) )
CALL DSCAL( BLKSIZ, SCL, WORK( INDRV1+1 ), 1 )
*
* Solve the system LU = Pb.