summaryrefslogtreecommitdiff
path: root/SRC/zgebal.f
diff options
context:
space:
mode:
authorjames <james@8a072113-8704-0410-8d35-dd094bca7971>2013-05-16 18:55:48 +0000
committerjames <james@8a072113-8704-0410-8d35-dd094bca7971>2013-05-16 18:55:48 +0000
commit78de161a101e23236d6804b7e7f9ba66845d9586 (patch)
treeaeb29d27f46e3727620cddb723b9e6b9ddc07ba6 /SRC/zgebal.f
parent0dbca9069031ea055e3c54fcb72087fe48a290ab (diff)
downloadlapack-78de161a101e23236d6804b7e7f9ba66845d9586.tar.gz
lapack-78de161a101e23236d6804b7e7f9ba66845d9586.tar.bz2
lapack-78de161a101e23236d6804b7e7f9ba66845d9586.zip
Now using 2-norm to compute vector norms of row and column for balancing algorithm.
This seems to fix problems with balancing causing very large backward error for certain Hessenberg matrices, including the often cited example of Watkins.
Diffstat (limited to 'SRC/zgebal.f')
-rw-r--r--SRC/zgebal.f16
1 files changed, 5 insertions, 11 deletions
diff --git a/SRC/zgebal.f b/SRC/zgebal.f
index 9c90f0b4..aa4f6d0e 100644
--- a/SRC/zgebal.f
+++ b/SRC/zgebal.f
@@ -194,8 +194,8 @@
* .. External Functions ..
LOGICAL DISNAN, LSAME
INTEGER IZAMAX
- DOUBLE PRECISION DLAMCH
- EXTERNAL DISNAN, LSAME, IZAMAX, DLAMCH
+ DOUBLE PRECISION DLAMCH, DZNRM2
+ EXTERNAL DISNAN, LSAME, IZAMAX, DLAMCH, DZNRM2
* ..
* .. External Subroutines ..
EXTERNAL XERBLA, ZDSCAL, ZSWAP
@@ -324,15 +324,9 @@
NOCONV = .FALSE.
*
DO 200 I = K, L
- C = ZERO
- R = ZERO
-*
- DO 150 J = K, L
- IF( J.EQ.I )
- $ GO TO 150
- C = C + CABS1( A( J, I ) )
- R = R + CABS1( A( I, J ) )
- 150 CONTINUE
+*
+ C = DZNRM2( L-K+1, A( K, I ), 1 )
+ R = DZNRM2( L-K+1, A( I, K ), LDA )
ICA = IZAMAX( L, A( 1, I ), 1 )
CA = ABS( A( ICA, I ) )
IRA = IZAMAX( N-K+1, A( I, K ), LDA )