summaryrefslogtreecommitdiff
path: root/SRC/sgebal.f
diff options
context:
space:
mode:
authorjulie <julielangou@users.noreply.github.com>2010-03-18 19:31:57 +0000
committerjulie <julielangou@users.noreply.github.com>2010-03-18 19:31:57 +0000
commit86e2baba6e03e6a204c86152a3e0d8f1246f2b99 (patch)
treefb4bf9d9c80a4570fac61342f2589e7459cca0bb /SRC/sgebal.f
parent40261349abdcec2c813c008ff5ff73373f851607 (diff)
downloadlapack-86e2baba6e03e6a204c86152a3e0d8f1246f2b99.tar.gz
lapack-86e2baba6e03e6a204c86152a3e0d8f1246f2b99.tar.bz2
lapack-86e2baba6e03e6a204c86152a3e0d8f1246f2b99.zip
Fix bug0048-Hanging could occur in *gebal if a NaN is in input matrix sent by Alexander Kobotov(Intel) to lapack on Feb 3rd 2010
Diffstat (limited to 'SRC/sgebal.f')
-rw-r--r--SRC/sgebal.f12
1 files changed, 10 insertions, 2 deletions
diff --git a/SRC/sgebal.f b/SRC/sgebal.f
index d4df3c67..b780ae7b 100644
--- a/SRC/sgebal.f
+++ b/SRC/sgebal.f
@@ -116,10 +116,10 @@
$ 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
@@ -279,6 +279,14 @@
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