summaryrefslogtreecommitdiff
path: root/SRC/cgebal.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/cgebal.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/cgebal.f')
-rw-r--r--SRC/cgebal.f16
1 files changed, 5 insertions, 11 deletions
diff --git a/SRC/cgebal.f b/SRC/cgebal.f
index 4bb5a2f0..47207ea3 100644
--- a/SRC/cgebal.f
+++ b/SRC/cgebal.f
@@ -195,8 +195,8 @@
* .. External Functions ..
LOGICAL SISNAN, LSAME
INTEGER ICAMAX
- REAL SLAMCH
- EXTERNAL SISNAN, LSAME, ICAMAX, SLAMCH
+ REAL SLAMCH, SCNRM2
+ EXTERNAL SISNAN, LSAME, ICAMAX, SLAMCH, SCNRM2
* ..
* .. External Subroutines ..
EXTERNAL CSSCAL, CSWAP, XERBLA
@@ -325,15 +325,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 = SCNRM2( L-K+1, A( K, I ), 1 )
+ R = SCNRM2( L-K+1, A( I , K ), LDA )
ICA = ICAMAX( L, A( 1, I ), 1 )
CA = ABS( A( ICA, I ) )
IRA = ICAMAX( N-K+1, A( I, K ), LDA )