aboutsummaryrefslogtreecommitdiff
path: root/SRC/slantr.f
diff options
context:
space:
mode:
authorjames <james@8a072113-8704-0410-8d35-dd094bca7971>2012-07-16 14:21:07 +0000
committerjames <james@8a072113-8704-0410-8d35-dd094bca7971>2012-07-16 14:21:07 +0000
commitb0ccd072d7381538a5947bc93908abeabaaf83d8 (patch)
treefc3e26f33d620d6968d56441ca92a256a071c3e6 /SRC/slantr.f
parent8989738d77f02c7b50839e69ab8a2ed8aac75024 (diff)
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/slantr.f')
-rw-r--r--SRC/slantr.f25
1 files changed, 15 insertions, 10 deletions
diff --git a/SRC/slantr.f b/SRC/slantr.f
index a25c2855..083dfd49 100644
--- a/SRC/slantr.f
+++ b/SRC/slantr.f
@@ -169,11 +169,11 @@
EXTERNAL SLASSQ
* ..
* .. External Functions ..
- LOGICAL LSAME
- EXTERNAL LSAME
+ LOGICAL LSAME, SISNAN
+ EXTERNAL LSAME, SISNAN
* ..
* .. Intrinsic Functions ..
- INTRINSIC ABS, MAX, MIN, SQRT
+ INTRINSIC ABS, MIN, SQRT
* ..
* .. Executable Statements ..
*
@@ -188,13 +188,15 @@
IF( LSAME( UPLO, 'U' ) ) THEN
DO 20 J = 1, N
DO 10 I = 1, MIN( M, J-1 )
- VALUE = MAX( VALUE, ABS( A( I, J ) ) )
+ SUM = ABS( A( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
10 CONTINUE
20 CONTINUE
ELSE
DO 40 J = 1, N
DO 30 I = J + 1, M
- VALUE = MAX( VALUE, ABS( A( I, J ) ) )
+ SUM = ABS( A( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
30 CONTINUE
40 CONTINUE
END IF
@@ -203,13 +205,15 @@
IF( LSAME( UPLO, 'U' ) ) THEN
DO 60 J = 1, N
DO 50 I = 1, MIN( M, J )
- VALUE = MAX( VALUE, ABS( A( I, J ) ) )
+ SUM = ABS( A( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
50 CONTINUE
60 CONTINUE
ELSE
DO 80 J = 1, N
DO 70 I = J, M
- VALUE = MAX( VALUE, ABS( A( I, J ) ) )
+ SUM = ABS( A( I, J ) )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
70 CONTINUE
80 CONTINUE
END IF
@@ -233,7 +237,7 @@
SUM = SUM + ABS( A( I, J ) )
100 CONTINUE
END IF
- VALUE = MAX( VALUE, SUM )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
110 CONTINUE
ELSE
DO 140 J = 1, N
@@ -248,7 +252,7 @@
SUM = SUM + ABS( A( I, J ) )
130 CONTINUE
END IF
- VALUE = MAX( VALUE, SUM )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
140 CONTINUE
END IF
ELSE IF( LSAME( NORM, 'I' ) ) THEN
@@ -301,7 +305,8 @@
END IF
VALUE = ZERO
DO 280 I = 1, M
- VALUE = MAX( VALUE, WORK( I ) )
+ SUM = WORK( I )
+ IF( VALUE .LT. SUM .OR. SISNAN( SUM ) ) VALUE = SUM
280 CONTINUE
ELSE IF( ( LSAME( NORM, 'F' ) ) .OR. ( LSAME( NORM, 'E' ) ) ) THEN
*