COMPLEX CDUM
* ..
* .. External Functions ..
- LOGICAL LSAME
+ LOGICAL SISNAN, LSAME
INTEGER ICAMAX
REAL SLAMCH
- EXTERNAL LSAME, ICAMAX, SLAMCH
+ EXTERNAL SISNAN, LSAME, ICAMAX, SLAMCH
* ..
* .. External Subroutines ..
EXTERNAL CSSCAL, CSWAP, XERBLA
160 CONTINUE
IF( C.GE.G .OR. MAX( F, C, CA ).GE.SFMAX2 .OR.
$ MIN( R, G, RA ).LE.SFMIN2 )GO TO 170
+ IF( SISNAN( C+F+CA+R+G+RA ) ) THEN
+*
+* Exit if NaN to avoid infinite loop
+*
+ INFO = -3
+ CALL XERBLA( 'CGEBAL', -INFO )
+ RETURN
+ END IF
F = F*SCLFAC
C = C*SCLFAC
CA = CA*SCLFAC
$ SFMIN2
* ..
* .. External Functions ..
- LOGICAL LSAME
+ LOGICAL DISNAN, LSAME
INTEGER IDAMAX
DOUBLE PRECISION DLAMCH
- EXTERNAL LSAME, IDAMAX, DLAMCH
+ EXTERNAL DISNAN, LSAME, IDAMAX, DLAMCH
* ..
* .. External Subroutines ..
EXTERNAL DSCAL, DSWAP, XERBLA
160 CONTINUE
IF( C.GE.G .OR. MAX( F, C, CA ).GE.SFMAX2 .OR.
$ MIN( R, G, RA ).LE.SFMIN2 )GO TO 170
+ IF( DISNAN( C+F+CA+R+G+RA ) ) THEN
+*
+* Exit if NaN to avoid infinite loop
+*
+ INFO = -3
+ CALL XERBLA( 'DGEBAL', -INFO )
+ RETURN
+ END IF
F = F*SCLFAC
C = C*SCLFAC
CA = CA*SCLFAC
$ SFMIN2
* ..
* .. External Functions ..
- LOGICAL LSAME
+ LOGICAL SISNAN, LSAME
INTEGER ISAMAX
REAL SLAMCH
- EXTERNAL LSAME, ISAMAX, SLAMCH
+ EXTERNAL SISNAN, LSAME, ISAMAX, SLAMCH
* ..
* .. External Subroutines ..
EXTERNAL SSCAL, SSWAP, XERBLA
180 CONTINUE
IF( G.LT.R .OR. MAX( R, RA ).GE.SFMAX2 .OR.
$ MIN( F, C, G, CA ).LE.SFMIN2 )GO TO 190
+ IF( SISNAN( C+F+CA+R+G+RA ) ) THEN
+*
+* Exit if NaN to avoid infinite loop
+*
+ INFO = -3
+ CALL XERBLA( 'SGEBAL', -INFO )
+ RETURN
+ END IF
F = F / SCLFAC
C = C / SCLFAC
G = G / SCLFAC
COMPLEX*16 CDUM
* ..
* .. External Functions ..
- LOGICAL LSAME
+ LOGICAL DISNAN, LSAME
INTEGER IZAMAX
DOUBLE PRECISION DLAMCH
- EXTERNAL LSAME, IZAMAX, DLAMCH
+ EXTERNAL DISNAN, LSAME, IZAMAX, DLAMCH
* ..
* .. External Subroutines ..
EXTERNAL XERBLA, ZDSCAL, ZSWAP
160 CONTINUE
IF( C.GE.G .OR. MAX( F, C, CA ).GE.SFMAX2 .OR.
$ MIN( R, G, RA ).LE.SFMIN2 )GO TO 170
+ IF( DISNAN( C+F+CA+R+G+RA ) ) THEN
+*
+* Exit if NaN to avoid infinite loop
+*
+ INFO = -3
+ CALL XERBLA( 'ZGEBAL', -INFO )
+ RETURN
+ END IF
F = F*SCLFAC
C = C*SCLFAC
CA = CA*SCLFAC