From: langou Date: Wed, 25 Mar 2015 22:45:19 +0000 (+0000) Subject: **** Correct bug 125 **** X-Git-Tag: accepted/tizen/5.0/unified/20181102.024111~376 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d99316e83b648c4db688056578c6a32fe55d1ce;p=platform%2Fupstream%2Flapack.git **** Correct bug 125 **** Change the maximum number of QR iterations (ITMAX) for xLAHQR from ITMAX=30 to ITMAX = 30 * MAX( 10, NH ). Bug reported by Yoshihide Okimi on July 16, 2014 https://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=13&t=4566 and, independently, by Marco Caliari (Università di Verona) on February 11, 2015. Involved in bug fix: Yoshihide Okimi, Marco Caliari (Università di Verona), Meiyue Shao (LBL), Julien Langou, and Daniel Kressner (EPFL). ** Bug ** xLAHQR v3.5 does not converge on some matrices while xLAHQR v2 converges ** Note ** xLAHQR v2 is available through ARPACK so xLAHQR v2 is still in "wide" use ** Description ** xLAQR0 v3.5 and xLAQR4 v3.5 have ITMAX set to: ITMAX = MAX( 30, 2*KEXSH )*MAX( 10, ( IHI-ILO+1 ) ) xLAHQR v2 has ITMAX set to: ITMAX = 30 * NH xLAHQR v3.5 has ITMAX set to: ITMAX = 30 Yoshihide Okimi reports that, in his application, (1) xLAHQR v3.5 does not converge, (2) xLAHQR v2 converges, (3) changing ITMAX to 30*NH in xLAHQR v3.5 enables convergence. Marco Caliari reports that, in his application, using xLAHQR v2.0 converges, while xLAHQR v3.5 does not converge. ** Bug fix ** Set ITMAX in xLAHQR to ITMAX = 30 * MAX( 10, NH ) Email from Meiyue: I feel that setting ITMAX proportional to NH makes sense. Perhaps we can change ITMAX to ITMAX*MAX( 10, NH ) so that it is also safe for ill-conditioned tiny matrices. --- diff --git a/SRC/clahqr.f b/SRC/clahqr.f index b99cb69..ad9dafb 100644 --- a/SRC/clahqr.f +++ b/SRC/clahqr.f @@ -211,8 +211,6 @@ * ========================================================= * * .. Parameters .. - INTEGER ITMAX - PARAMETER ( ITMAX = 30 ) COMPLEX ZERO, ONE PARAMETER ( ZERO = ( 0.0e0, 0.0e0 ), $ ONE = ( 1.0e0, 0.0e0 ) ) @@ -226,7 +224,8 @@ $ V2, X, Y REAL AA, AB, BA, BB, H10, H21, RTEMP, S, SAFMAX, $ SAFMIN, SMLNUM, SX, T2, TST, ULP - INTEGER I, I1, I2, ITS, J, JHI, JLO, K, L, M, NH, NZ + INTEGER I, I1, I2, ITS, ITMAX, J, JHI, JLO, K, L, M, + $ NH, NZ * .. * .. Local Arrays .. COMPLEX V( 2 ) @@ -312,6 +311,10 @@ I2 = N END IF * +* ITMAX is the total number of QR iterations allowed. +* + ITMAX = 30 * MAX( 10, NH ) +* * The main loop begins here. I is the loop index and decreases from * IHI to ILO in steps of 1. Each iteration of the loop works * with the active submatrix in rows and columns L to I. diff --git a/SRC/dlahqr.f b/SRC/dlahqr.f index 9da6b0f..d1a6765 100644 --- a/SRC/dlahqr.f +++ b/SRC/dlahqr.f @@ -223,8 +223,6 @@ * ========================================================= * * .. Parameters .. - INTEGER ITMAX - PARAMETER ( ITMAX = 30 ) DOUBLE PRECISION ZERO, ONE, TWO PARAMETER ( ZERO = 0.0d0, ONE = 1.0d0, TWO = 2.0d0 ) DOUBLE PRECISION DAT1, DAT2 @@ -235,7 +233,7 @@ $ H22, RT1I, RT1R, RT2I, RT2R, RTDISC, S, SAFMAX, $ SAFMIN, SMLNUM, SN, SUM, T1, T2, T3, TR, TST, $ ULP, V2, V3 - INTEGER I, I1, I2, ITS, J, K, L, M, NH, NR, NZ + INTEGER I, I1, I2, ITS, ITMAX, J, K, L, M, NH, NR, NZ * .. * .. Local Arrays .. DOUBLE PRECISION V( 3 ) @@ -292,6 +290,10 @@ I2 = N END IF * +* ITMAX is the total number of QR iterations allowed. +* + ITMAX = 30 * MAX( 10, NH ) +* * The main loop begins here. I is the loop index and decreases from * IHI to ILO in steps of 1 or 2. Each iteration of the loop works * with the active submatrix in rows and columns L to I. diff --git a/SRC/slahqr.f b/SRC/slahqr.f index b3caf68..f88fac8 100644 --- a/SRC/slahqr.f +++ b/SRC/slahqr.f @@ -223,8 +223,6 @@ * ========================================================= * * .. Parameters .. - INTEGER ITMAX - PARAMETER ( ITMAX = 30 ) REAL ZERO, ONE, TWO PARAMETER ( ZERO = 0.0e0, ONE = 1.0e0, TWO = 2.0e0 ) REAL DAT1, DAT2 @@ -235,7 +233,7 @@ $ H22, RT1I, RT1R, RT2I, RT2R, RTDISC, S, SAFMAX, $ SAFMIN, SMLNUM, SN, SUM, T1, T2, T3, TR, TST, $ ULP, V2, V3 - INTEGER I, I1, I2, ITS, J, K, L, M, NH, NR, NZ + INTEGER I, I1, I2, ITS, ITMAX, J, K, L, M, NH, NR, NZ * .. * .. Local Arrays .. REAL V( 3 ) @@ -292,6 +290,10 @@ I2 = N END IF * +* ITMAX is the total number of QR iterations allowed. +* + ITMAX = 30 * MAX( 10, NH ) +* * The main loop begins here. I is the loop index and decreases from * IHI to ILO in steps of 1 or 2. Each iteration of the loop works * with the active submatrix in rows and columns L to I. diff --git a/SRC/zlahqr.f b/SRC/zlahqr.f index 344a9f8..5249654 100644 --- a/SRC/zlahqr.f +++ b/SRC/zlahqr.f @@ -211,8 +211,6 @@ * ========================================================= * * .. Parameters .. - INTEGER ITMAX - PARAMETER ( ITMAX = 30 ) COMPLEX*16 ZERO, ONE PARAMETER ( ZERO = ( 0.0d0, 0.0d0 ), $ ONE = ( 1.0d0, 0.0d0 ) ) @@ -226,7 +224,8 @@ $ V2, X, Y DOUBLE PRECISION AA, AB, BA, BB, H10, H21, RTEMP, S, SAFMAX, $ SAFMIN, SMLNUM, SX, T2, TST, ULP - INTEGER I, I1, I2, ITS, J, JHI, JLO, K, L, M, NH, NZ + INTEGER I, I1, I2, ITS, ITMAX, J, JHI, JLO, K, L, M, + $ NH, NZ * .. * .. Local Arrays .. COMPLEX*16 V( 2 ) @@ -312,6 +311,10 @@ I2 = N END IF * +* ITMAX is the total number of QR iterations allowed. +* + ITMAX = 30 * MAX( 10, NH ) +* * The main loop begins here. I is the loop index and decreases from * IHI to ILO in steps of 1. Each iteration of the loop works * with the active submatrix in rows and columns L to I.