You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

clahqr.f 18 kB

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