diff options
author | james <james@8a072113-8704-0410-8d35-dd094bca7971> | 2012-07-16 14:21:07 +0000 |
---|---|---|
committer | james <james@8a072113-8704-0410-8d35-dd094bca7971> | 2012-07-16 14:21:07 +0000 |
commit | b0ccd072d7381538a5947bc93908abeabaaf83d8 (patch) | |
tree | fc3e26f33d620d6968d56441ca92a256a071c3e6 /SRC/dlangb.f | |
parent | 8989738d77f02c7b50839e69ab8a2ed8aac75024 (diff) | |
download | lapack-b0ccd072d7381538a5947bc93908abeabaaf83d8.tar.gz lapack-b0ccd072d7381538a5947bc93908abeabaaf83d8.tar.bz2 lapack-b0ccd072d7381538a5947bc93908abeabaaf83d8.zip |
matrix norms now consistently return nan when input matrix contains a nan;
previously, this was (usually) only the case for the 'F' norm
Diffstat (limited to 'SRC/dlangb.f')
-rw-r--r-- | SRC/dlangb.f | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/SRC/dlangb.f b/SRC/dlangb.f index 6aa5527b..9e4785d4 100644 --- a/SRC/dlangb.f +++ b/SRC/dlangb.f @@ -146,14 +146,14 @@ * .. * .. Local Scalars .. INTEGER I, J, K, L - DOUBLE PRECISION SCALE, SUM, VALUE + DOUBLE PRECISION SCALE, SUM, VALUE, TEMP * .. * .. External Subroutines .. EXTERNAL DLASSQ * .. * .. External Functions .. - LOGICAL LSAME - EXTERNAL LSAME + LOGICAL LSAME, DISNAN + EXTERNAL LSAME, DISNAN * .. * .. Intrinsic Functions .. INTRINSIC ABS, MAX, MIN, SQRT @@ -169,7 +169,8 @@ VALUE = ZERO DO 20 J = 1, N DO 10 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 ) - VALUE = MAX( VALUE, ABS( AB( I, J ) ) ) + TEMP = ABS( AB( I, J ) ) + IF( VALUE.LT.TEMP .OR. DISNAN( TEMP ) ) VALUE = TEMP 10 CONTINUE 20 CONTINUE ELSE IF( ( LSAME( NORM, 'O' ) ) .OR. ( NORM.EQ.'1' ) ) THEN @@ -182,7 +183,7 @@ DO 30 I = MAX( KU+2-J, 1 ), MIN( N+KU+1-J, KL+KU+1 ) SUM = SUM + ABS( AB( I, J ) ) 30 CONTINUE - VALUE = MAX( VALUE, SUM ) + IF( VALUE.LT.SUM .OR. DISNAN( SUM ) ) VALUE = SUM 40 CONTINUE ELSE IF( LSAME( NORM, 'I' ) ) THEN * @@ -199,7 +200,8 @@ 70 CONTINUE VALUE = ZERO DO 80 I = 1, N - VALUE = MAX( VALUE, WORK( I ) ) + TEMP = WORK( I ) + IF( VALUE.LT.TEMP .OR. DISNAN( TEMP ) ) VALUE = TEMP 80 CONTINUE ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN * |