From 27bef224d9e4e8fdadc0e33d70c98d9a10a0d149 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 24 Feb 2011 21:12:23 +0000 Subject: [PATCH] changed matrix norm to 'M' (max) from 'I' (inf) for scaling of input matrix and added check for zero norm in xSTERF (the xSTEQR already had this check) this fixes the issue reported in bug0036 --- SRC/dsteqr.f | 2 +- SRC/dsterf.f | 9 ++++++--- SRC/ssteqr.f | 2 +- SRC/ssterf.f | 4 +++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/SRC/dsteqr.f b/SRC/dsteqr.f index a0ec5cdb..17a17468 100644 --- a/SRC/dsteqr.f +++ b/SRC/dsteqr.f @@ -195,7 +195,7 @@ * * Scale submatrix in rows and columns L to LEND * - ANORM = DLANST( 'I', LEND-L+1, D( L ), E( L ) ) + ANORM = DLANST( 'M', LEND-L+1, D( L ), E( L ) ) ISCALE = 0 IF( ANORM.EQ.ZERO ) $ GO TO 10 diff --git a/SRC/dsterf.f b/SRC/dsterf.f index 4f2a9bcf..74f289b6 100644 --- a/SRC/dsterf.f +++ b/SRC/dsterf.f @@ -54,7 +54,7 @@ $ NMAXIT DOUBLE PRECISION ALPHA, ANORM, BB, C, EPS, EPS2, GAMMA, OLDC, $ OLDGAM, P, R, RT1, RT2, RTE, S, SAFMAX, SAFMIN, - $ SIGMA, SSFMAX, SSFMIN + $ SIGMA, SSFMAX, SSFMIN, RMAX * .. * .. External Functions .. DOUBLE PRECISION DLAMCH, DLANST, DLAPY2 @@ -90,6 +90,7 @@ SAFMAX = ONE / SAFMIN SSFMAX = SQRT( SAFMAX ) / THREE SSFMIN = SQRT( SAFMIN ) / EPS2 + RMAX = DLAMCH( 'O' ) * * Compute the eigenvalues of the tridiagonal matrix. * @@ -128,9 +129,11 @@ * * Scale submatrix in rows and columns L to LEND * - ANORM = DLANST( 'I', LEND-L+1, D( L ), E( L ) ) + ANORM = DLANST( 'M', LEND-L+1, D( L ), E( L ) ) ISCALE = 0 - IF( ANORM.GT.SSFMAX ) THEN + IF( ANORM.EQ.ZERO ) + $ GO TO 10 + IF( (ANORM.GT.SSFMAX) ) THEN ISCALE = 1 CALL DLASCL( 'G', 0, 0, ANORM, SSFMAX, LEND-L+1, 1, D( L ), N, $ INFO ) diff --git a/SRC/ssteqr.f b/SRC/ssteqr.f index 952fb502..835c82fc 100644 --- a/SRC/ssteqr.f +++ b/SRC/ssteqr.f @@ -195,7 +195,7 @@ * * Scale submatrix in rows and columns L to LEND * - ANORM = SLANST( 'I', LEND-L+1, D( L ), E( L ) ) + ANORM = SLANST( 'M', LEND-L+1, D( L ), E( L ) ) ISCALE = 0 IF( ANORM.EQ.ZERO ) $ GO TO 10 diff --git a/SRC/ssterf.f b/SRC/ssterf.f index a51c379d..b9110dd6 100644 --- a/SRC/ssterf.f +++ b/SRC/ssterf.f @@ -128,8 +128,10 @@ * * Scale submatrix in rows and columns L to LEND * - ANORM = SLANST( 'I', LEND-L+1, D( L ), E( L ) ) + ANORM = SLANST( 'M', LEND-L+1, D( L ), E( L ) ) ISCALE = 0 + IF( ANORM.EQ.ZERO ) + $ GO TO 10 IF( ANORM.GT.SSFMAX ) THEN ISCALE = 1 CALL SLASCL( 'G', 0, 0, ANORM, SSFMAX, LEND-L+1, 1, D( L ), N, -- 2.34.1