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/zlanhp.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/zlanhp.f')
-rw-r--r-- | SRC/zlanhp.f | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/SRC/zlanhp.f b/SRC/zlanhp.f index cf36cad0..496e04c7 100644 --- a/SRC/zlanhp.f +++ b/SRC/zlanhp.f @@ -142,14 +142,14 @@ DOUBLE PRECISION ABSA, SCALE, SUM, VALUE * .. * .. External Functions .. - LOGICAL LSAME - EXTERNAL LSAME + LOGICAL LSAME, DISNAN + EXTERNAL LSAME, DISNAN * .. * .. External Subroutines .. EXTERNAL ZLASSQ * .. * .. Intrinsic Functions .. - INTRINSIC ABS, DBLE, MAX, SQRT + INTRINSIC ABS, DBLE, SQRT * .. * .. Executable Statements .. * @@ -164,17 +164,21 @@ K = 0 DO 20 J = 1, N DO 10 I = K + 1, K + J - 1 - VALUE = MAX( VALUE, ABS( AP( I ) ) ) + SUM = ABS( AP( I ) ) + IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM 10 CONTINUE K = K + J - VALUE = MAX( VALUE, ABS( DBLE( AP( K ) ) ) ) + SUM = ABS( DBLE( AP( K ) ) ) + IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM 20 CONTINUE ELSE K = 1 DO 40 J = 1, N - VALUE = MAX( VALUE, ABS( DBLE( AP( K ) ) ) ) + SUM = ABS( DBLE( AP( K ) ) ) + IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM DO 30 I = K + 1, K + N - J - VALUE = MAX( VALUE, ABS( AP( I ) ) ) + SUM = ABS( AP( I ) ) + IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM 30 CONTINUE K = K + N - J + 1 40 CONTINUE @@ -199,7 +203,8 @@ K = K + 1 60 CONTINUE DO 70 I = 1, N - VALUE = MAX( VALUE, WORK( I ) ) + SUM = WORK( I ) + IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM 70 CONTINUE ELSE DO 80 I = 1, N @@ -214,7 +219,7 @@ WORK( I ) = WORK( I ) + ABSA K = K + 1 90 CONTINUE - VALUE = MAX( VALUE, SUM ) + IF( VALUE .LT. SUM .OR. DISNAN( SUM ) ) VALUE = SUM 100 CONTINUE END IF ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN |