Télécharger dlahqr.eso

Retour à la liste

Numérotation des lignes :

  1. C DLAHQR SOURCE BP208322 18/07/10 21:15:08 9872
  2. *
  3. *> \brief \b DLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using the double-shift/single-shift QR algorithm.
  4. *
  5. * =========== DOCUMENTATION ===========
  6. *
  7. * Online html documentation available at
  8. * http://www.netlib.org/lapack/explore-html/
  9. *
  10. *> \htmlonly
  11. *> Download DLAHQR + dependencies
  12. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlahqr.f">
  13. *> [TGZ]</a>
  14. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlahqr.f">
  15. *> [ZIP]</a>
  16. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlahqr.f">
  17. *> [TXT]</a>
  18. *> \endhtmlonly
  19. *
  20. * Definition:
  21. * ===========
  22. *
  23. * SUBROUTINE DLAHQR( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
  24. * ILOZ, IHIZ, Z, LDZ, INFO )
  25. *
  26. * .. Scalar Arguments ..
  27. * INTEGER IHI, IHIZ, ILO, ILOZ, INFO, LDH, LDZ, N
  28. * LOGICAL WANTT, WANTZ
  29. * ..
  30. * .. Array Arguments ..
  31. * DOUBLE PRECISION H( LDH, * ), WI( * ), WR( * ), Z( LDZ, * )
  32. * ..
  33. *
  34. *
  35. *> \par Purpose:
  36. * =============
  37. *>
  38. *> \verbatim
  39. *>
  40. *> DLAHQR is an auxiliary routine called by DHSEQR to update the
  41. *> eigenvalues and Schur decomposition already computed by DHSEQR, by
  42. *> dealing with the Hessenberg submatrix in rows and columns ILO to
  43. *> IHI.
  44. *> \endverbatim
  45. *
  46. * Arguments:
  47. * ==========
  48. *
  49. *> \param[in] WANTT
  50. *> \verbatim
  51. *> WANTT is LOGICAL
  52. *> = .TRUE. : the full Schur form T is required;
  53. *> = .FALSE.: only eigenvalues are required.
  54. *> \endverbatim
  55. *>
  56. *> \param[in] WANTZ
  57. *> \verbatim
  58. *> WANTZ is LOGICAL
  59. *> = .TRUE. : the matrix of Schur vectors Z is required;
  60. *> = .FALSE.: Schur vectors are not required.
  61. *> \endverbatim
  62. *>
  63. *> \param[in] N
  64. *> \verbatim
  65. *> N is INTEGER
  66. *> The order of the matrix H. N >= 0.
  67. *> \endverbatim
  68. *>
  69. *> \param[in] ILO
  70. *> \verbatim
  71. *> ILO is INTEGER
  72. *> \endverbatim
  73. *>
  74. *> \param[in] IHI
  75. *> \verbatim
  76. *> IHI is INTEGER
  77. *> It is assumed that H is already upper quasi-triangular in
  78. *> rows and columns IHI+1:N, and that H(ILO,ILO-1) = 0 (unless
  79. *> ILO = 1). DLAHQR works primarily with the Hessenberg
  80. *> submatrix in rows and columns ILO to IHI, but applies
  81. *> transformations to all of H if WANTT is .TRUE..
  82. *> 1 <= ILO <= max(1,IHI); IHI <= N.
  83. *> \endverbatim
  84. *>
  85. *> \param[in,out] H
  86. *> \verbatim
  87. *> H is DOUBLE PRECISION array, dimension (LDH,N)
  88. *> On entry, the upper Hessenberg matrix H.
  89. *> On exit, if INFO is zero and if WANTT is .TRUE., H is upper
  90. *> quasi-triangular in rows and columns ILO:IHI, with any
  91. *> 2-by-2 diagonal blocks in standard form. If INFO is zero
  92. *> and WANTT is .FALSE., the contents of H are unspecified on
  93. *> exit. The output state of H if INFO is nonzero is given
  94. *> below under the description of INFO.
  95. *> \endverbatim
  96. *>
  97. *> \param[in] LDH
  98. *> \verbatim
  99. *> LDH is INTEGER
  100. *> The leading dimension of the array H. LDH >= max(1,N).
  101. *> \endverbatim
  102. *>
  103. *> \param[out] WR
  104. *> \verbatim
  105. *> WR is DOUBLE PRECISION array, dimension (N)
  106. *> \endverbatim
  107. *>
  108. *> \param[out] WI
  109. *> \verbatim
  110. *> WI is DOUBLE PRECISION array, dimension (N)
  111. *> The real and imaginary parts, respectively, of the computed
  112. *> eigenvalues ILO to IHI are stored in the corresponding
  113. *> elements of WR and WI. If two eigenvalues are computed as a
  114. *> complex conjugate pair, they are stored in consecutive
  115. *> elements of WR and WI, say the i-th and (i+1)th, with
  116. *> WI(i) > 0 and WI(i+1) < 0. If WANTT is .TRUE., the
  117. *> eigenvalues are stored in the same order as on the diagonal
  118. *> of the Schur form returned in H, with WR(i) = H(i,i), and, if
  119. *> H(i:i+1,i:i+1) is a 2-by-2 diagonal block,
  120. *> WI(i) = sqrt(H(i+1,i)*H(i,i+1)) and WI(i+1) = -WI(i).
  121. *> \endverbatim
  122. *>
  123. *> \param[in] ILOZ
  124. *> \verbatim
  125. *> ILOZ is INTEGER
  126. *> \endverbatim
  127. *>
  128. *> \param[in] IHIZ
  129. *> \verbatim
  130. *> IHIZ is INTEGER
  131. *> Specify the rows of Z to which transformations must be
  132. *> applied if WANTZ is .TRUE..
  133. *> 1 <= ILOZ <= ILO; IHI <= IHIZ <= N.
  134. *> \endverbatim
  135. *>
  136. *> \param[in,out] Z
  137. *> \verbatim
  138. *> Z is DOUBLE PRECISION array, dimension (LDZ,N)
  139. *> If WANTZ is .TRUE., on entry Z must contain the current
  140. *> matrix Z of transformations accumulated by DHSEQR, and on
  141. *> exit Z has been updated; transformations are applied only to
  142. *> the submatrix Z(ILOZ:IHIZ,ILO:IHI).
  143. *> If WANTZ is .FALSE., Z is not referenced.
  144. *> \endverbatim
  145. *>
  146. *> \param[in] LDZ
  147. *> \verbatim
  148. *> LDZ is INTEGER
  149. *> The leading dimension of the array Z. LDZ >= max(1,N).
  150. *> \endverbatim
  151. *>
  152. *> \param[out] INFO
  153. *> \verbatim
  154. *> INFO is INTEGER
  155. *> = 0: successful exit
  156. *> .GT. 0: If INFO = i, DLAHQR failed to compute all the
  157. *> eigenvalues ILO to IHI in a total of 30 iterations
  158. *> per eigenvalue; elements i+1:ihi of WR and WI
  159. *> contain those eigenvalues which have been
  160. *> successfully computed.
  161. *>
  162. *> If INFO .GT. 0 and WANTT is .FALSE., then on exit,
  163. *> the remaining unconverged eigenvalues are the
  164. *> eigenvalues of the upper Hessenberg matrix rows
  165. *> and columns ILO thorugh INFO of the final, output
  166. *> value of H.
  167. *>
  168. *> If INFO .GT. 0 and WANTT is .TRUE., then on exit
  169. *> (*) (initial value of H)*U = U*(final value of H)
  170. *> where U is an orthognal matrix. The final
  171. *> value of H is upper Hessenberg and triangular in
  172. *> rows and columns INFO+1 through IHI.
  173. *>
  174. *> If INFO .GT. 0 and WANTZ is .TRUE., then on exit
  175. *> (final value of Z) = (initial value of Z)*U
  176. *> where U is the orthogonal matrix in (*)
  177. *> (regardless of the value of WANTT.)
  178. *> \endverbatim
  179. *
  180. * Authors:
  181. * ========
  182. *
  183. *> \author Univ. of Tennessee
  184. *> \author Univ. of California Berkeley
  185. *> \author Univ. of Colorado Denver
  186. *> \author NAG Ltd.
  187. *
  188. *> \date December 2016
  189. *
  190. *> \ingroup doubleOTHERauxiliary
  191. *
  192. *> \par Further Details:
  193. * =====================
  194. *>
  195. *> \verbatim
  196. *>
  197. *> 02-96 Based on modifications by
  198. *> David Day, Sandia National Laboratory, USA
  199. *>
  200. *> 12-04 Further modifications by
  201. *> Ralph Byers, University of Kansas, USA
  202. *> This is a modified version of DLAHQR from LAPACK version 3.0.
  203. *> It is (1) more robust against overflow and underflow and
  204. *> (2) adopts the more conservative Ahues & Tisseur stopping
  205. *> criterion (LAWN 122, 1997).
  206. *> \endverbatim
  207. *>
  208. * =====================================================================
  209. SUBROUTINE DLAHQR( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI,
  210. $ ILOZ, IHIZ, Z, LDZ, INFO )
  211. *
  212. * -- LAPACK auxiliary routine (version 3.7.0) --
  213. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  214. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  215. * December 2016
  216. *
  217. * .. Scalar Arguments ..
  218. INTEGER IHI, IHIZ, ILO, ILOZ, INFO, LDH, LDZ, N
  219. LOGICAL WANTT, WANTZ
  220. * ..
  221. * .. Array Arguments ..
  222. REAL*8 H( LDH, * ), WI( * ), WR( * ), Z( LDZ, * )
  223. * ..
  224. *
  225. * =========================================================
  226. *
  227. * .. Parameters ..
  228. REAL*8 ZERO, ONE, TWO
  229. PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0, TWO = 2.0d0 )
  230. REAL*8 DAT1, DAT2
  231. PARAMETER ( DAT1 = 0.75D+0, DAT2 = -0.4375D+0 )
  232. * ..
  233. * .. Local Scalars ..
  234. REAL*8 AA, AB, BA, BB, CS, DET, H11, H12, H21, H21S,
  235. $ H22, RT1I, RT1R, RT2I, RT2R, RTDISC, S, SAFMAX,
  236. $ SAFMIN, SMLNUM, SN, SUM, T1, T2, T3, TR, TST,
  237. $ ULP, V2, V3
  238. INTEGER I, I1, I2, ITS, ITMAX, J, K, L, M, NH, NR, NZ
  239. * ..
  240. * .. Local Arrays ..
  241. REAL*8 V( 3 )
  242. * ..
  243. * .. External Functions ..
  244. REAL*8 DLAMCH
  245. EXTERNAL DLAMCH
  246. * ..
  247. * .. External Subroutines ..
  248. EXTERNAL DCOPY, DLABAD, DLANV2, DLARFG, DROT
  249. * ..
  250. ** .. Intrinsic Functions ..
  251. * INTRINSIC ABS, DBLE, MAX, MIN, SQRT
  252. ** ..
  253. ** .. Executable Statements ..
  254. *
  255. INFO = 0
  256. *
  257. * Quick return if possible
  258. *
  259. IF( N.EQ.0 )
  260. $ RETURN
  261. IF( ILO.EQ.IHI ) THEN
  262. WR( ILO ) = H( ILO, ILO )
  263. WI( ILO ) = ZERO
  264. RETURN
  265. END IF
  266. *
  267. * ==== clear out the trash ====
  268. DO 10 J = ILO, IHI - 3
  269. H( J+2, J ) = ZERO
  270. H( J+3, J ) = ZERO
  271. 10 CONTINUE
  272. IF( ILO.LE.IHI-2 )
  273. $ H( IHI, IHI-2 ) = ZERO
  274. *
  275. NH = IHI - ILO + 1
  276. NZ = IHIZ - ILOZ + 1
  277. *
  278. * Set machine-dependent constants for the stopping criterion.
  279. *
  280. SAFMIN = DLAMCH( 'SAFE MINIMUM' )
  281. SAFMAX = ONE / SAFMIN
  282. CALL DLABAD( SAFMIN, SAFMAX )
  283. ULP = DLAMCH( 'PRECISION' )
  284. SMLNUM = SAFMIN*( DBLE( NH ) / ULP )
  285. *
  286. * I1 and I2 are the indices of the first row and last column of H
  287. * to which transformations must be applied. If eigenvalues only are
  288. * being computed, I1 and I2 are set inside the main loop.
  289. *
  290. IF( WANTT ) THEN
  291. I1 = 1
  292. I2 = N
  293. END IF
  294. *
  295. * ITMAX is the total number of QR iterations allowed.
  296. *
  297. ITMAX = 30 * MAX( 10, NH )
  298. *
  299. * The main loop begins here. I is the loop index and decreases from
  300. * IHI to ILO in steps of 1 or 2. Each iteration of the loop works
  301. * with the active submatrix in rows and columns L to I.
  302. * Eigenvalues I+1 to IHI have already converged. Either L = ILO or
  303. * H(L,L-1) is negligible so that the matrix splits.
  304. *
  305. I = IHI
  306. 20 CONTINUE
  307. L = ILO
  308. IF( I.LT.ILO )
  309. $ GO TO 160
  310. *
  311. * Perform QR iterations on rows and columns ILO to I until a
  312. * submatrix of order 1 or 2 splits off at the bottom because a
  313. * subdiagonal element has become negligible.
  314. *
  315. DO 140 ITS = 0, ITMAX
  316. *
  317. * Look for a single small subdiagonal element.
  318. *
  319. DO 30 K = I, L + 1, -1
  320. IF( ABS( H( K, K-1 ) ).LE.SMLNUM )
  321. $ GO TO 40
  322. TST = ABS( H( K-1, K-1 ) ) + ABS( H( K, K ) )
  323. IF( TST.EQ.ZERO ) THEN
  324. IF( K-2.GE.ILO )
  325. $ TST = TST + ABS( H( K-1, K-2 ) )
  326. IF( K+1.LE.IHI )
  327. $ TST = TST + ABS( H( K+1, K ) )
  328. END IF
  329. * ==== The following is a conservative small subdiagonal
  330. * . deflation criterion due to Ahues & Tisseur (LAWN 122,
  331. * . 1997). It has better mathematical foundation and
  332. * . improves accuracy in some cases. ====
  333. IF( ABS( H( K, K-1 ) ).LE.ULP*TST ) THEN
  334. AB = MAX( ABS( H( K, K-1 ) ), ABS( H( K-1, K ) ) )
  335. BA = MIN( ABS( H( K, K-1 ) ), ABS( H( K-1, K ) ) )
  336. AA = MAX( ABS( H( K, K ) ),
  337. $ ABS( H( K-1, K-1 )-H( K, K ) ) )
  338. BB = MIN( ABS( H( K, K ) ),
  339. $ ABS( H( K-1, K-1 )-H( K, K ) ) )
  340. S = AA + AB
  341. IF( BA*( AB / S ).LE.MAX( SMLNUM,
  342. $ ULP*( BB*( AA / S ) ) ) )GO TO 40
  343. END IF
  344. 30 CONTINUE
  345. 40 CONTINUE
  346. L = K
  347. IF( L.GT.ILO ) THEN
  348. *
  349. * H(L,L-1) is negligible
  350. *
  351. H( L, L-1 ) = ZERO
  352. END IF
  353. *
  354. * Exit from loop if a submatrix of order 1 or 2 has split off.
  355. *
  356. IF( L.GE.I-1 )
  357. $ GO TO 150
  358. *
  359. * Now the active submatrix is in rows and columns L to I. If
  360. * eigenvalues only are being computed, only the active submatrix
  361. * need be transformed.
  362. *
  363. IF( .NOT.WANTT ) THEN
  364. I1 = L
  365. I2 = I
  366. END IF
  367. *
  368. IF( ITS.EQ.10 ) THEN
  369. *
  370. * Exceptional shift.
  371. *
  372. S = ABS( H( L+1, L ) ) + ABS( H( L+2, L+1 ) )
  373. H11 = DAT1*S + H( L, L )
  374. H12 = DAT2*S
  375. H21 = S
  376. H22 = H11
  377. ELSE IF( ITS.EQ.20 ) THEN
  378. *
  379. * Exceptional shift.
  380. *
  381. S = ABS( H( I, I-1 ) ) + ABS( H( I-1, I-2 ) )
  382. H11 = DAT1*S + H( I, I )
  383. H12 = DAT2*S
  384. H21 = S
  385. H22 = H11
  386. ELSE
  387. *
  388. * Prepare to use Francis' double shift
  389. * (i.e. 2nd degree generalized Rayleigh quotient)
  390. *
  391. H11 = H( I-1, I-1 )
  392. H21 = H( I, I-1 )
  393. H12 = H( I-1, I )
  394. H22 = H( I, I )
  395. END IF
  396. S = ABS( H11 ) + ABS( H12 ) + ABS( H21 ) + ABS( H22 )
  397. IF( S.EQ.ZERO ) THEN
  398. RT1R = ZERO
  399. RT1I = ZERO
  400. RT2R = ZERO
  401. RT2I = ZERO
  402. ELSE
  403. H11 = H11 / S
  404. H21 = H21 / S
  405. H12 = H12 / S
  406. H22 = H22 / S
  407. TR = ( H11+H22 ) / TWO
  408. DET = ( H11-TR )*( H22-TR ) - H12*H21
  409. RTDISC = SQRT( ABS( DET ) )
  410. IF( DET.GE.ZERO ) THEN
  411. *
  412. * ==== complex conjugate shifts ====
  413. *
  414. RT1R = TR*S
  415. RT2R = RT1R
  416. RT1I = RTDISC*S
  417. RT2I = -RT1I
  418. ELSE
  419. *
  420. * ==== real shifts (use only one of them) ====
  421. *
  422. RT1R = TR + RTDISC
  423. RT2R = TR - RTDISC
  424. IF( ABS( RT1R-H22 ).LE.ABS( RT2R-H22 ) ) THEN
  425. RT1R = RT1R*S
  426. RT2R = RT1R
  427. ELSE
  428. RT2R = RT2R*S
  429. RT1R = RT2R
  430. END IF
  431. RT1I = ZERO
  432. RT2I = ZERO
  433. END IF
  434. END IF
  435. *
  436. * Look for two consecutive small subdiagonal elements.
  437. *
  438. DO 50 M = I - 2, L, -1
  439. * Determine the effect of starting the double-shift QR
  440. * iteration at row M, and see if this would make H(M,M-1)
  441. * negligible. (The following uses scaling to avoid
  442. * overflows and most underflows.)
  443. *
  444. H21S = H( M+1, M )
  445. S = ABS( H( M, M )-RT2R ) + ABS( RT2I ) + ABS( H21S )
  446. H21S = H( M+1, M ) / S
  447. V( 1 ) = H21S*H( M, M+1 ) + ( H( M, M )-RT1R )*
  448. $ ( ( H( M, M )-RT2R ) / S ) - RT1I*( RT2I / S )
  449. V( 2 ) = H21S*( H( M, M )+H( M+1, M+1 )-RT1R-RT2R )
  450. V( 3 ) = H21S*H( M+2, M+1 )
  451. S = ABS( V( 1 ) ) + ABS( V( 2 ) ) + ABS( V( 3 ) )
  452. V( 1 ) = V( 1 ) / S
  453. V( 2 ) = V( 2 ) / S
  454. V( 3 ) = V( 3 ) / S
  455. IF( M.EQ.L )
  456. $ GO TO 60
  457. IF( ABS( H( M, M-1 ) )*( ABS( V( 2 ) )+ABS( V( 3 ) ) ).LE.
  458. $ ULP*ABS( V( 1 ) )*( ABS( H( M-1, M-1 ) )+ABS( H( M,
  459. $ M ) )+ABS( H( M+1, M+1 ) ) ) )GO TO 60
  460. 50 CONTINUE
  461. 60 CONTINUE
  462. *
  463. * Double-shift QR step
  464. *
  465. DO 130 K = M, I - 1
  466. *
  467. * The first iteration of this loop determines a reflection G
  468. * from the vector V and applies it from left and right to H,
  469. * thus creating a nonzero bulge below the subdiagonal.
  470. *
  471. * Each subsequent iteration determines a reflection G to
  472. * restore the Hessenberg form in the (K-1)th column, and thus
  473. * chases the bulge one step toward the bottom of the active
  474. * submatrix. NR is the order of G.
  475. *
  476. NR = MIN( 3, I-K+1 )
  477. IF( K.GT.M )
  478. $ CALL DCOPY( NR, H( K, K-1 ), 1, V, 1 )
  479. CALL DLARFG( NR, V( 1 ), V( 2 ), 1, T1 )
  480. IF( K.GT.M ) THEN
  481. H( K, K-1 ) = V( 1 )
  482. H( K+1, K-1 ) = ZERO
  483. IF( K.LT.I-1 )
  484. $ H( K+2, K-1 ) = ZERO
  485. ELSE IF( M.GT.L ) THEN
  486. * ==== Use the following instead of
  487. * . H( K, K-1 ) = -H( K, K-1 ) to
  488. * . avoid a bug when v(2) and v(3)
  489. * . underflow. ====
  490. H( K, K-1 ) = H( K, K-1 )*( ONE-T1 )
  491. END IF
  492. V2 = V( 2 )
  493. T2 = T1*V2
  494. IF( NR.EQ.3 ) THEN
  495. V3 = V( 3 )
  496. T3 = T1*V3
  497. *
  498. * Apply G from the left to transform the rows of the matrix
  499. * in columns K to I2.
  500. *
  501. DO 70 J = K, I2
  502. SUM = H( K, J ) + V2*H( K+1, J ) + V3*H( K+2, J )
  503. H( K, J ) = H( K, J ) - SUM*T1
  504. H( K+1, J ) = H( K+1, J ) - SUM*T2
  505. H( K+2, J ) = H( K+2, J ) - SUM*T3
  506. 70 CONTINUE
  507. *
  508. * Apply G from the right to transform the columns of the
  509. * matrix in rows I1 to min(K+3,I).
  510. *
  511. DO 80 J = I1, MIN( K+3, I )
  512. SUM = H( J, K ) + V2*H( J, K+1 ) + V3*H( J, K+2 )
  513. H( J, K ) = H( J, K ) - SUM*T1
  514. H( J, K+1 ) = H( J, K+1 ) - SUM*T2
  515. H( J, K+2 ) = H( J, K+2 ) - SUM*T3
  516. 80 CONTINUE
  517. *
  518. IF( WANTZ ) THEN
  519. *
  520. * Accumulate transformations in the matrix Z
  521. *
  522. DO 90 J = ILOZ, IHIZ
  523. SUM = Z( J, K ) + V2*Z( J, K+1 ) + V3*Z( J, K+2 )
  524. Z( J, K ) = Z( J, K ) - SUM*T1
  525. Z( J, K+1 ) = Z( J, K+1 ) - SUM*T2
  526. Z( J, K+2 ) = Z( J, K+2 ) - SUM*T3
  527. 90 CONTINUE
  528. END IF
  529. ELSE IF( NR.EQ.2 ) THEN
  530. *
  531. * Apply G from the left to transform the rows of the matrix
  532. * in columns K to I2.
  533. *
  534. DO 100 J = K, I2
  535. SUM = H( K, J ) + V2*H( K+1, J )
  536. H( K, J ) = H( K, J ) - SUM*T1
  537. H( K+1, J ) = H( K+1, J ) - SUM*T2
  538. 100 CONTINUE
  539. *
  540. * Apply G from the right to transform the columns of the
  541. * matrix in rows I1 to min(K+3,I).
  542. *
  543. DO 110 J = I1, I
  544. SUM = H( J, K ) + V2*H( J, K+1 )
  545. H( J, K ) = H( J, K ) - SUM*T1
  546. H( J, K+1 ) = H( J, K+1 ) - SUM*T2
  547. 110 CONTINUE
  548. *
  549. IF( WANTZ ) THEN
  550. *
  551. * Accumulate transformations in the matrix Z
  552. *
  553. DO 120 J = ILOZ, IHIZ
  554. SUM = Z( J, K ) + V2*Z( J, K+1 )
  555. Z( J, K ) = Z( J, K ) - SUM*T1
  556. Z( J, K+1 ) = Z( J, K+1 ) - SUM*T2
  557. 120 CONTINUE
  558. END IF
  559. END IF
  560. 130 CONTINUE
  561. *
  562. 140 CONTINUE
  563. *
  564. * Failure to converge in remaining number of iterations
  565. *
  566. INFO = I
  567. RETURN
  568. *
  569. 150 CONTINUE
  570. *
  571. IF( L.EQ.I ) THEN
  572. *
  573. * H(I,I-1) is negligible: one eigenvalue has converged.
  574. *
  575. WR( I ) = H( I, I )
  576. WI( I ) = ZERO
  577. ELSE IF( L.EQ.I-1 ) THEN
  578. *
  579. * H(I-1,I-2) is negligible: a pair of eigenvalues have converged.
  580. *
  581. * Transform the 2-by-2 submatrix to standard Schur form,
  582. * and compute and store the eigenvalues.
  583. *
  584. CALL DLANV2( H( I-1, I-1 ), H( I-1, I ), H( I, I-1 ),
  585. $ H( I, I ), WR( I-1 ), WI( I-1 ), WR( I ), WI( I ),
  586. $ CS, SN )
  587. *
  588. IF( WANTT ) THEN
  589. *
  590. * Apply the transformation to the rest of H.
  591. *
  592. IF( I2.GT.I )
  593. $ CALL DROT( I2-I, H( I-1, I+1 ), LDH, H( I, I+1 ), LDH,
  594. $ CS, SN )
  595. CALL DROT( I-I1-1, H( I1, I-1 ), 1, H( I1, I ), 1, CS, SN )
  596. END IF
  597. IF( WANTZ ) THEN
  598. *
  599. * Apply the transformation to Z.
  600. *
  601. CALL DROT( NZ, Z( ILOZ, I-1 ), 1, Z( ILOZ, I ), 1, CS, SN )
  602. END IF
  603. END IF
  604. *
  605. * return to start of the main loop with new value of I.
  606. *
  607. I = L - 1
  608. GO TO 20
  609. *
  610. 160 CONTINUE
  611. RETURN
  612. *
  613. * End of DLAHQR
  614. *
  615. END
  616.  
  617.  
  618.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales