From 78de161a101e23236d6804b7e7f9ba66845d9586 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 16 May 2013 18:55:48 +0000 Subject: 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. --- SRC/cgebal.f | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'SRC/cgebal.f') 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 ) -- cgit v1.2.3