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.

dlarrv.f 43 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  1. *> \brief \b DLARRV computes the eigenvectors of the tridiagonal matrix T = L D LT given L, D and the eigenvalues of L D LT.
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. *> \htmlonly
  9. *> Download DLARRV + dependencies
  10. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlarrv.f">
  11. *> [TGZ]</a>
  12. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlarrv.f">
  13. *> [ZIP]</a>
  14. *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlarrv.f">
  15. *> [TXT]</a>
  16. *> \endhtmlonly
  17. *
  18. * Definition:
  19. * ===========
  20. *
  21. * SUBROUTINE DLARRV( N, VL, VU, D, L, PIVMIN,
  22. * ISPLIT, M, DOL, DOU, MINRGP,
  23. * RTOL1, RTOL2, W, WERR, WGAP,
  24. * IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ,
  25. * WORK, IWORK, INFO )
  26. *
  27. * .. Scalar Arguments ..
  28. * INTEGER DOL, DOU, INFO, LDZ, M, N
  29. * DOUBLE PRECISION MINRGP, PIVMIN, RTOL1, RTOL2, VL, VU
  30. * ..
  31. * .. Array Arguments ..
  32. * INTEGER IBLOCK( * ), INDEXW( * ), ISPLIT( * ),
  33. * $ ISUPPZ( * ), IWORK( * )
  34. * DOUBLE PRECISION D( * ), GERS( * ), L( * ), W( * ), WERR( * ),
  35. * $ WGAP( * ), WORK( * )
  36. * DOUBLE PRECISION Z( LDZ, * )
  37. * ..
  38. *
  39. *
  40. *> \par Purpose:
  41. * =============
  42. *>
  43. *> \verbatim
  44. *>
  45. *> DLARRV computes the eigenvectors of the tridiagonal matrix
  46. *> T = L D L**T given L, D and APPROXIMATIONS to the eigenvalues of L D L**T.
  47. *> The input eigenvalues should have been computed by DLARRE.
  48. *> \endverbatim
  49. *
  50. * Arguments:
  51. * ==========
  52. *
  53. *> \param[in] N
  54. *> \verbatim
  55. *> N is INTEGER
  56. *> The order of the matrix. N >= 0.
  57. *> \endverbatim
  58. *>
  59. *> \param[in] VL
  60. *> \verbatim
  61. *> VL is DOUBLE PRECISION
  62. *> \endverbatim
  63. *>
  64. *> \param[in] VU
  65. *> \verbatim
  66. *> VU is DOUBLE PRECISION
  67. *> Lower and upper bounds of the interval that contains the desired
  68. *> eigenvalues. VL < VU. Needed to compute gaps on the left or right
  69. *> end of the extremal eigenvalues in the desired RANGE.
  70. *> \endverbatim
  71. *>
  72. *> \param[in,out] D
  73. *> \verbatim
  74. *> D is DOUBLE PRECISION array, dimension (N)
  75. *> On entry, the N diagonal elements of the diagonal matrix D.
  76. *> On exit, D may be overwritten.
  77. *> \endverbatim
  78. *>
  79. *> \param[in,out] L
  80. *> \verbatim
  81. *> L is DOUBLE PRECISION array, dimension (N)
  82. *> On entry, the (N-1) subdiagonal elements of the unit
  83. *> bidiagonal matrix L are in elements 1 to N-1 of L
  84. *> (if the matrix is not splitted.) At the end of each block
  85. *> is stored the corresponding shift as given by DLARRE.
  86. *> On exit, L is overwritten.
  87. *> \endverbatim
  88. *>
  89. *> \param[in] PIVMIN
  90. *> \verbatim
  91. *> PIVMIN is DOUBLE PRECISION
  92. *> The minimum pivot allowed in the Sturm sequence.
  93. *> \endverbatim
  94. *>
  95. *> \param[in] ISPLIT
  96. *> \verbatim
  97. *> ISPLIT is INTEGER array, dimension (N)
  98. *> The splitting points, at which T breaks up into blocks.
  99. *> The first block consists of rows/columns 1 to
  100. *> ISPLIT( 1 ), the second of rows/columns ISPLIT( 1 )+1
  101. *> through ISPLIT( 2 ), etc.
  102. *> \endverbatim
  103. *>
  104. *> \param[in] M
  105. *> \verbatim
  106. *> M is INTEGER
  107. *> The total number of input eigenvalues. 0 <= M <= N.
  108. *> \endverbatim
  109. *>
  110. *> \param[in] DOL
  111. *> \verbatim
  112. *> DOL is INTEGER
  113. *> \endverbatim
  114. *>
  115. *> \param[in] DOU
  116. *> \verbatim
  117. *> DOU is INTEGER
  118. *> If the user wants to compute only selected eigenvectors from all
  119. *> the eigenvalues supplied, he can specify an index range DOL:DOU.
  120. *> Or else the setting DOL=1, DOU=M should be applied.
  121. *> Note that DOL and DOU refer to the order in which the eigenvalues
  122. *> are stored in W.
  123. *> If the user wants to compute only selected eigenpairs, then
  124. *> the columns DOL-1 to DOU+1 of the eigenvector space Z contain the
  125. *> computed eigenvectors. All other columns of Z are set to zero.
  126. *> \endverbatim
  127. *>
  128. *> \param[in] MINRGP
  129. *> \verbatim
  130. *> MINRGP is DOUBLE PRECISION
  131. *> \endverbatim
  132. *>
  133. *> \param[in] RTOL1
  134. *> \verbatim
  135. *> RTOL1 is DOUBLE PRECISION
  136. *> \endverbatim
  137. *>
  138. *> \param[in] RTOL2
  139. *> \verbatim
  140. *> RTOL2 is DOUBLE PRECISION
  141. *> Parameters for bisection.
  142. *> An interval [LEFT,RIGHT] has converged if
  143. *> RIGHT-LEFT.LT.MAX( RTOL1*GAP, RTOL2*MAX(|LEFT|,|RIGHT|) )
  144. *> \endverbatim
  145. *>
  146. *> \param[in,out] W
  147. *> \verbatim
  148. *> W is DOUBLE PRECISION array, dimension (N)
  149. *> The first M elements of W contain the APPROXIMATE eigenvalues for
  150. *> which eigenvectors are to be computed. The eigenvalues
  151. *> should be grouped by split-off block and ordered from
  152. *> smallest to largest within the block ( The output array
  153. *> W from DLARRE is expected here ). Furthermore, they are with
  154. *> respect to the shift of the corresponding root representation
  155. *> for their block. On exit, W holds the eigenvalues of the
  156. *> UNshifted matrix.
  157. *> \endverbatim
  158. *>
  159. *> \param[in,out] WERR
  160. *> \verbatim
  161. *> WERR is DOUBLE PRECISION array, dimension (N)
  162. *> The first M elements contain the semiwidth of the uncertainty
  163. *> interval of the corresponding eigenvalue in W
  164. *> \endverbatim
  165. *>
  166. *> \param[in,out] WGAP
  167. *> \verbatim
  168. *> WGAP is DOUBLE PRECISION array, dimension (N)
  169. *> The separation from the right neighbor eigenvalue in W.
  170. *> \endverbatim
  171. *>
  172. *> \param[in] IBLOCK
  173. *> \verbatim
  174. *> IBLOCK is INTEGER array, dimension (N)
  175. *> The indices of the blocks (submatrices) associated with the
  176. *> corresponding eigenvalues in W; IBLOCK(i)=1 if eigenvalue
  177. *> W(i) belongs to the first block from the top, =2 if W(i)
  178. *> belongs to the second block, etc.
  179. *> \endverbatim
  180. *>
  181. *> \param[in] INDEXW
  182. *> \verbatim
  183. *> INDEXW is INTEGER array, dimension (N)
  184. *> The indices of the eigenvalues within each block (submatrix);
  185. *> for example, INDEXW(i)= 10 and IBLOCK(i)=2 imply that the
  186. *> i-th eigenvalue W(i) is the 10-th eigenvalue in the second block.
  187. *> \endverbatim
  188. *>
  189. *> \param[in] GERS
  190. *> \verbatim
  191. *> GERS is DOUBLE PRECISION array, dimension (2*N)
  192. *> The N Gerschgorin intervals (the i-th Gerschgorin interval
  193. *> is (GERS(2*i-1), GERS(2*i)). The Gerschgorin intervals should
  194. *> be computed from the original UNshifted matrix.
  195. *> \endverbatim
  196. *>
  197. *> \param[out] Z
  198. *> \verbatim
  199. *> Z is DOUBLE PRECISION array, dimension (LDZ, max(1,M) )
  200. *> If INFO = 0, the first M columns of Z contain the
  201. *> orthonormal eigenvectors of the matrix T
  202. *> corresponding to the input eigenvalues, with the i-th
  203. *> column of Z holding the eigenvector associated with W(i).
  204. *> Note: the user must ensure that at least max(1,M) columns are
  205. *> supplied in the array Z.
  206. *> \endverbatim
  207. *>
  208. *> \param[in] LDZ
  209. *> \verbatim
  210. *> LDZ is INTEGER
  211. *> The leading dimension of the array Z. LDZ >= 1, and if
  212. *> JOBZ = 'V', LDZ >= max(1,N).
  213. *> \endverbatim
  214. *>
  215. *> \param[out] ISUPPZ
  216. *> \verbatim
  217. *> ISUPPZ is INTEGER array, dimension ( 2*max(1,M) )
  218. *> The support of the eigenvectors in Z, i.e., the indices
  219. *> indicating the nonzero elements in Z. The I-th eigenvector
  220. *> is nonzero only in elements ISUPPZ( 2*I-1 ) through
  221. *> ISUPPZ( 2*I ).
  222. *> \endverbatim
  223. *>
  224. *> \param[out] WORK
  225. *> \verbatim
  226. *> WORK is DOUBLE PRECISION array, dimension (12*N)
  227. *> \endverbatim
  228. *>
  229. *> \param[out] IWORK
  230. *> \verbatim
  231. *> IWORK is INTEGER array, dimension (7*N)
  232. *> \endverbatim
  233. *>
  234. *> \param[out] INFO
  235. *> \verbatim
  236. *> INFO is INTEGER
  237. *> = 0: successful exit
  238. *>
  239. *> > 0: A problem occured in DLARRV.
  240. *> < 0: One of the called subroutines signaled an internal problem.
  241. *> Needs inspection of the corresponding parameter IINFO
  242. *> for further information.
  243. *>
  244. *> =-1: Problem in DLARRB when refining a child's eigenvalues.
  245. *> =-2: Problem in DLARRF when computing the RRR of a child.
  246. *> When a child is inside a tight cluster, it can be difficult
  247. *> to find an RRR. A partial remedy from the user's point of
  248. *> view is to make the parameter MINRGP smaller and recompile.
  249. *> However, as the orthogonality of the computed vectors is
  250. *> proportional to 1/MINRGP, the user should be aware that
  251. *> he might be trading in precision when he decreases MINRGP.
  252. *> =-3: Problem in DLARRB when refining a single eigenvalue
  253. *> after the Rayleigh correction was rejected.
  254. *> = 5: The Rayleigh Quotient Iteration failed to converge to
  255. *> full accuracy in MAXITR steps.
  256. *> \endverbatim
  257. *
  258. * Authors:
  259. * ========
  260. *
  261. *> \author Univ. of Tennessee
  262. *> \author Univ. of California Berkeley
  263. *> \author Univ. of Colorado Denver
  264. *> \author NAG Ltd.
  265. *
  266. *> \date November 2015
  267. *
  268. *> \ingroup doubleOTHERauxiliary
  269. *
  270. *> \par Contributors:
  271. * ==================
  272. *>
  273. *> Beresford Parlett, University of California, Berkeley, USA \n
  274. *> Jim Demmel, University of California, Berkeley, USA \n
  275. *> Inderjit Dhillon, University of Texas, Austin, USA \n
  276. *> Osni Marques, LBNL/NERSC, USA \n
  277. *> Christof Voemel, University of California, Berkeley, USA
  278. *
  279. * =====================================================================
  280. SUBROUTINE DLARRV( N, VL, VU, D, L, PIVMIN,
  281. $ ISPLIT, M, DOL, DOU, MINRGP,
  282. $ RTOL1, RTOL2, W, WERR, WGAP,
  283. $ IBLOCK, INDEXW, GERS, Z, LDZ, ISUPPZ,
  284. $ WORK, IWORK, INFO )
  285. *
  286. * -- LAPACK auxiliary routine (version 3.6.0) --
  287. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  288. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  289. * November 2015
  290. *
  291. * .. Scalar Arguments ..
  292. INTEGER DOL, DOU, INFO, LDZ, M, N
  293. DOUBLE PRECISION MINRGP, PIVMIN, RTOL1, RTOL2, VL, VU
  294. * ..
  295. * .. Array Arguments ..
  296. INTEGER IBLOCK( * ), INDEXW( * ), ISPLIT( * ),
  297. $ ISUPPZ( * ), IWORK( * )
  298. DOUBLE PRECISION D( * ), GERS( * ), L( * ), W( * ), WERR( * ),
  299. $ WGAP( * ), WORK( * )
  300. DOUBLE PRECISION Z( LDZ, * )
  301. * ..
  302. *
  303. * =====================================================================
  304. *
  305. * .. Parameters ..
  306. INTEGER MAXITR
  307. PARAMETER ( MAXITR = 10 )
  308. DOUBLE PRECISION ZERO, ONE, TWO, THREE, FOUR, HALF
  309. PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0,
  310. $ TWO = 2.0D0, THREE = 3.0D0,
  311. $ FOUR = 4.0D0, HALF = 0.5D0)
  312. * ..
  313. * .. Local Scalars ..
  314. LOGICAL ESKIP, NEEDBS, STP2II, TRYRQC, USEDBS, USEDRQ
  315. INTEGER DONE, I, IBEGIN, IDONE, IEND, II, IINDC1,
  316. $ IINDC2, IINDR, IINDWK, IINFO, IM, IN, INDEIG,
  317. $ INDLD, INDLLD, INDWRK, ISUPMN, ISUPMX, ITER,
  318. $ ITMP1, J, JBLK, K, MINIWSIZE, MINWSIZE, NCLUS,
  319. $ NDEPTH, NEGCNT, NEWCLS, NEWFST, NEWFTT, NEWLST,
  320. $ NEWSIZ, OFFSET, OLDCLS, OLDFST, OLDIEN, OLDLST,
  321. $ OLDNCL, P, PARITY, Q, WBEGIN, WEND, WINDEX,
  322. $ WINDMN, WINDPL, ZFROM, ZTO, ZUSEDL, ZUSEDU,
  323. $ ZUSEDW
  324. DOUBLE PRECISION BSTRES, BSTW, EPS, FUDGE, GAP, GAPTOL, GL, GU,
  325. $ LAMBDA, LEFT, LGAP, MINGMA, NRMINV, RESID,
  326. $ RGAP, RIGHT, RQCORR, RQTOL, SAVGAP, SGNDEF,
  327. $ SIGMA, SPDIAM, SSIGMA, TAU, TMP, TOL, ZTZ
  328. * ..
  329. * .. External Functions ..
  330. DOUBLE PRECISION DLAMCH
  331. EXTERNAL DLAMCH
  332. * ..
  333. * .. External Subroutines ..
  334. EXTERNAL DCOPY, DLAR1V, DLARRB, DLARRF, DLASET,
  335. $ DSCAL
  336. * ..
  337. * .. Intrinsic Functions ..
  338. INTRINSIC ABS, DBLE, MAX, MIN
  339. * ..
  340. * .. Executable Statements ..
  341. * ..
  342. INFO = 0
  343. * The first N entries of WORK are reserved for the eigenvalues
  344. INDLD = N+1
  345. INDLLD= 2*N+1
  346. INDWRK= 3*N+1
  347. MINWSIZE = 12 * N
  348. DO 5 I= 1,MINWSIZE
  349. WORK( I ) = ZERO
  350. 5 CONTINUE
  351. * IWORK(IINDR+1:IINDR+N) hold the twist indices R for the
  352. * factorization used to compute the FP vector
  353. IINDR = 0
  354. * IWORK(IINDC1+1:IINC2+N) are used to store the clusters of the current
  355. * layer and the one above.
  356. IINDC1 = N
  357. IINDC2 = 2*N
  358. IINDWK = 3*N + 1
  359. MINIWSIZE = 7 * N
  360. DO 10 I= 1,MINIWSIZE
  361. IWORK( I ) = 0
  362. 10 CONTINUE
  363. ZUSEDL = 1
  364. IF(DOL.GT.1) THEN
  365. * Set lower bound for use of Z
  366. ZUSEDL = DOL-1
  367. ENDIF
  368. ZUSEDU = M
  369. IF(DOU.LT.M) THEN
  370. * Set lower bound for use of Z
  371. ZUSEDU = DOU+1
  372. ENDIF
  373. * The width of the part of Z that is used
  374. ZUSEDW = ZUSEDU - ZUSEDL + 1
  375. CALL DLASET( 'Full', N, ZUSEDW, ZERO, ZERO,
  376. $ Z(1,ZUSEDL), LDZ )
  377. EPS = DLAMCH( 'Precision' )
  378. RQTOL = TWO * EPS
  379. *
  380. * Set expert flags for standard code.
  381. TRYRQC = .TRUE.
  382. IF((DOL.EQ.1).AND.(DOU.EQ.M)) THEN
  383. ELSE
  384. * Only selected eigenpairs are computed. Since the other evalues
  385. * are not refined by RQ iteration, bisection has to compute to full
  386. * accuracy.
  387. RTOL1 = FOUR * EPS
  388. RTOL2 = FOUR * EPS
  389. ENDIF
  390. * The entries WBEGIN:WEND in W, WERR, WGAP correspond to the
  391. * desired eigenvalues. The support of the nonzero eigenvector
  392. * entries is contained in the interval IBEGIN:IEND.
  393. * Remark that if k eigenpairs are desired, then the eigenvectors
  394. * are stored in k contiguous columns of Z.
  395. * DONE is the number of eigenvectors already computed
  396. DONE = 0
  397. IBEGIN = 1
  398. WBEGIN = 1
  399. DO 170 JBLK = 1, IBLOCK( M )
  400. IEND = ISPLIT( JBLK )
  401. SIGMA = L( IEND )
  402. * Find the eigenvectors of the submatrix indexed IBEGIN
  403. * through IEND.
  404. WEND = WBEGIN - 1
  405. 15 CONTINUE
  406. IF( WEND.LT.M ) THEN
  407. IF( IBLOCK( WEND+1 ).EQ.JBLK ) THEN
  408. WEND = WEND + 1
  409. GO TO 15
  410. END IF
  411. END IF
  412. IF( WEND.LT.WBEGIN ) THEN
  413. IBEGIN = IEND + 1
  414. GO TO 170
  415. ELSEIF( (WEND.LT.DOL).OR.(WBEGIN.GT.DOU) ) THEN
  416. IBEGIN = IEND + 1
  417. WBEGIN = WEND + 1
  418. GO TO 170
  419. END IF
  420. * Find local spectral diameter of the block
  421. GL = GERS( 2*IBEGIN-1 )
  422. GU = GERS( 2*IBEGIN )
  423. DO 20 I = IBEGIN+1 , IEND
  424. GL = MIN( GERS( 2*I-1 ), GL )
  425. GU = MAX( GERS( 2*I ), GU )
  426. 20 CONTINUE
  427. SPDIAM = GU - GL
  428. * OLDIEN is the last index of the previous block
  429. OLDIEN = IBEGIN - 1
  430. * Calculate the size of the current block
  431. IN = IEND - IBEGIN + 1
  432. * The number of eigenvalues in the current block
  433. IM = WEND - WBEGIN + 1
  434. * This is for a 1x1 block
  435. IF( IBEGIN.EQ.IEND ) THEN
  436. DONE = DONE+1
  437. Z( IBEGIN, WBEGIN ) = ONE
  438. ISUPPZ( 2*WBEGIN-1 ) = IBEGIN
  439. ISUPPZ( 2*WBEGIN ) = IBEGIN
  440. W( WBEGIN ) = W( WBEGIN ) + SIGMA
  441. WORK( WBEGIN ) = W( WBEGIN )
  442. IBEGIN = IEND + 1
  443. WBEGIN = WBEGIN + 1
  444. GO TO 170
  445. END IF
  446. * The desired (shifted) eigenvalues are stored in W(WBEGIN:WEND)
  447. * Note that these can be approximations, in this case, the corresp.
  448. * entries of WERR give the size of the uncertainty interval.
  449. * The eigenvalue approximations will be refined when necessary as
  450. * high relative accuracy is required for the computation of the
  451. * corresponding eigenvectors.
  452. CALL DCOPY( IM, W( WBEGIN ), 1,
  453. $ WORK( WBEGIN ), 1 )
  454. * We store in W the eigenvalue approximations w.r.t. the original
  455. * matrix T.
  456. DO 30 I=1,IM
  457. W(WBEGIN+I-1) = W(WBEGIN+I-1)+SIGMA
  458. 30 CONTINUE
  459. * NDEPTH is the current depth of the representation tree
  460. NDEPTH = 0
  461. * PARITY is either 1 or 0
  462. PARITY = 1
  463. * NCLUS is the number of clusters for the next level of the
  464. * representation tree, we start with NCLUS = 1 for the root
  465. NCLUS = 1
  466. IWORK( IINDC1+1 ) = 1
  467. IWORK( IINDC1+2 ) = IM
  468. * IDONE is the number of eigenvectors already computed in the current
  469. * block
  470. IDONE = 0
  471. * loop while( IDONE.LT.IM )
  472. * generate the representation tree for the current block and
  473. * compute the eigenvectors
  474. 40 CONTINUE
  475. IF( IDONE.LT.IM ) THEN
  476. * This is a crude protection against infinitely deep trees
  477. IF( NDEPTH.GT.M ) THEN
  478. INFO = -2
  479. RETURN
  480. ENDIF
  481. * breadth first processing of the current level of the representation
  482. * tree: OLDNCL = number of clusters on current level
  483. OLDNCL = NCLUS
  484. * reset NCLUS to count the number of child clusters
  485. NCLUS = 0
  486. *
  487. PARITY = 1 - PARITY
  488. IF( PARITY.EQ.0 ) THEN
  489. OLDCLS = IINDC1
  490. NEWCLS = IINDC2
  491. ELSE
  492. OLDCLS = IINDC2
  493. NEWCLS = IINDC1
  494. END IF
  495. * Process the clusters on the current level
  496. DO 150 I = 1, OLDNCL
  497. J = OLDCLS + 2*I
  498. * OLDFST, OLDLST = first, last index of current cluster.
  499. * cluster indices start with 1 and are relative
  500. * to WBEGIN when accessing W, WGAP, WERR, Z
  501. OLDFST = IWORK( J-1 )
  502. OLDLST = IWORK( J )
  503. IF( NDEPTH.GT.0 ) THEN
  504. * Retrieve relatively robust representation (RRR) of cluster
  505. * that has been computed at the previous level
  506. * The RRR is stored in Z and overwritten once the eigenvectors
  507. * have been computed or when the cluster is refined
  508. IF((DOL.EQ.1).AND.(DOU.EQ.M)) THEN
  509. * Get representation from location of the leftmost evalue
  510. * of the cluster
  511. J = WBEGIN + OLDFST - 1
  512. ELSE
  513. IF(WBEGIN+OLDFST-1.LT.DOL) THEN
  514. * Get representation from the left end of Z array
  515. J = DOL - 1
  516. ELSEIF(WBEGIN+OLDFST-1.GT.DOU) THEN
  517. * Get representation from the right end of Z array
  518. J = DOU
  519. ELSE
  520. J = WBEGIN + OLDFST - 1
  521. ENDIF
  522. ENDIF
  523. CALL DCOPY( IN, Z( IBEGIN, J ), 1, D( IBEGIN ), 1 )
  524. CALL DCOPY( IN-1, Z( IBEGIN, J+1 ), 1, L( IBEGIN ),
  525. $ 1 )
  526. SIGMA = Z( IEND, J+1 )
  527. * Set the corresponding entries in Z to zero
  528. CALL DLASET( 'Full', IN, 2, ZERO, ZERO,
  529. $ Z( IBEGIN, J), LDZ )
  530. END IF
  531. * Compute DL and DLL of current RRR
  532. DO 50 J = IBEGIN, IEND-1
  533. TMP = D( J )*L( J )
  534. WORK( INDLD-1+J ) = TMP
  535. WORK( INDLLD-1+J ) = TMP*L( J )
  536. 50 CONTINUE
  537. IF( NDEPTH.GT.0 ) THEN
  538. * P and Q are index of the first and last eigenvalue to compute
  539. * within the current block
  540. P = INDEXW( WBEGIN-1+OLDFST )
  541. Q = INDEXW( WBEGIN-1+OLDLST )
  542. * Offset for the arrays WORK, WGAP and WERR, i.e., the P-OFFSET
  543. * through the Q-OFFSET elements of these arrays are to be used.
  544. * OFFSET = P-OLDFST
  545. OFFSET = INDEXW( WBEGIN ) - 1
  546. * perform limited bisection (if necessary) to get approximate
  547. * eigenvalues to the precision needed.
  548. CALL DLARRB( IN, D( IBEGIN ),
  549. $ WORK(INDLLD+IBEGIN-1),
  550. $ P, Q, RTOL1, RTOL2, OFFSET,
  551. $ WORK(WBEGIN),WGAP(WBEGIN),WERR(WBEGIN),
  552. $ WORK( INDWRK ), IWORK( IINDWK ),
  553. $ PIVMIN, SPDIAM, IN, IINFO )
  554. IF( IINFO.NE.0 ) THEN
  555. INFO = -1
  556. RETURN
  557. ENDIF
  558. * We also recompute the extremal gaps. W holds all eigenvalues
  559. * of the unshifted matrix and must be used for computation
  560. * of WGAP, the entries of WORK might stem from RRRs with
  561. * different shifts. The gaps from WBEGIN-1+OLDFST to
  562. * WBEGIN-1+OLDLST are correctly computed in DLARRB.
  563. * However, we only allow the gaps to become greater since
  564. * this is what should happen when we decrease WERR
  565. IF( OLDFST.GT.1) THEN
  566. WGAP( WBEGIN+OLDFST-2 ) =
  567. $ MAX(WGAP(WBEGIN+OLDFST-2),
  568. $ W(WBEGIN+OLDFST-1)-WERR(WBEGIN+OLDFST-1)
  569. $ - W(WBEGIN+OLDFST-2)-WERR(WBEGIN+OLDFST-2) )
  570. ENDIF
  571. IF( WBEGIN + OLDLST -1 .LT. WEND ) THEN
  572. WGAP( WBEGIN+OLDLST-1 ) =
  573. $ MAX(WGAP(WBEGIN+OLDLST-1),
  574. $ W(WBEGIN+OLDLST)-WERR(WBEGIN+OLDLST)
  575. $ - W(WBEGIN+OLDLST-1)-WERR(WBEGIN+OLDLST-1) )
  576. ENDIF
  577. * Each time the eigenvalues in WORK get refined, we store
  578. * the newly found approximation with all shifts applied in W
  579. DO 53 J=OLDFST,OLDLST
  580. W(WBEGIN+J-1) = WORK(WBEGIN+J-1)+SIGMA
  581. 53 CONTINUE
  582. END IF
  583. * Process the current node.
  584. NEWFST = OLDFST
  585. DO 140 J = OLDFST, OLDLST
  586. IF( J.EQ.OLDLST ) THEN
  587. * we are at the right end of the cluster, this is also the
  588. * boundary of the child cluster
  589. NEWLST = J
  590. ELSE IF ( WGAP( WBEGIN + J -1).GE.
  591. $ MINRGP* ABS( WORK(WBEGIN + J -1) ) ) THEN
  592. * the right relative gap is big enough, the child cluster
  593. * (NEWFST,..,NEWLST) is well separated from the following
  594. NEWLST = J
  595. ELSE
  596. * inside a child cluster, the relative gap is not
  597. * big enough.
  598. GOTO 140
  599. END IF
  600. * Compute size of child cluster found
  601. NEWSIZ = NEWLST - NEWFST + 1
  602. * NEWFTT is the place in Z where the new RRR or the computed
  603. * eigenvector is to be stored
  604. IF((DOL.EQ.1).AND.(DOU.EQ.M)) THEN
  605. * Store representation at location of the leftmost evalue
  606. * of the cluster
  607. NEWFTT = WBEGIN + NEWFST - 1
  608. ELSE
  609. IF(WBEGIN+NEWFST-1.LT.DOL) THEN
  610. * Store representation at the left end of Z array
  611. NEWFTT = DOL - 1
  612. ELSEIF(WBEGIN+NEWFST-1.GT.DOU) THEN
  613. * Store representation at the right end of Z array
  614. NEWFTT = DOU
  615. ELSE
  616. NEWFTT = WBEGIN + NEWFST - 1
  617. ENDIF
  618. ENDIF
  619. IF( NEWSIZ.GT.1) THEN
  620. *
  621. * Current child is not a singleton but a cluster.
  622. * Compute and store new representation of child.
  623. *
  624. *
  625. * Compute left and right cluster gap.
  626. *
  627. * LGAP and RGAP are not computed from WORK because
  628. * the eigenvalue approximations may stem from RRRs
  629. * different shifts. However, W hold all eigenvalues
  630. * of the unshifted matrix. Still, the entries in WGAP
  631. * have to be computed from WORK since the entries
  632. * in W might be of the same order so that gaps are not
  633. * exhibited correctly for very close eigenvalues.
  634. IF( NEWFST.EQ.1 ) THEN
  635. LGAP = MAX( ZERO,
  636. $ W(WBEGIN)-WERR(WBEGIN) - VL )
  637. ELSE
  638. LGAP = WGAP( WBEGIN+NEWFST-2 )
  639. ENDIF
  640. RGAP = WGAP( WBEGIN+NEWLST-1 )
  641. *
  642. * Compute left- and rightmost eigenvalue of child
  643. * to high precision in order to shift as close
  644. * as possible and obtain as large relative gaps
  645. * as possible
  646. *
  647. DO 55 K =1,2
  648. IF(K.EQ.1) THEN
  649. P = INDEXW( WBEGIN-1+NEWFST )
  650. ELSE
  651. P = INDEXW( WBEGIN-1+NEWLST )
  652. ENDIF
  653. OFFSET = INDEXW( WBEGIN ) - 1
  654. CALL DLARRB( IN, D(IBEGIN),
  655. $ WORK( INDLLD+IBEGIN-1 ),P,P,
  656. $ RQTOL, RQTOL, OFFSET,
  657. $ WORK(WBEGIN),WGAP(WBEGIN),
  658. $ WERR(WBEGIN),WORK( INDWRK ),
  659. $ IWORK( IINDWK ), PIVMIN, SPDIAM,
  660. $ IN, IINFO )
  661. 55 CONTINUE
  662. *
  663. IF((WBEGIN+NEWLST-1.LT.DOL).OR.
  664. $ (WBEGIN+NEWFST-1.GT.DOU)) THEN
  665. * if the cluster contains no desired eigenvalues
  666. * skip the computation of that branch of the rep. tree
  667. *
  668. * We could skip before the refinement of the extremal
  669. * eigenvalues of the child, but then the representation
  670. * tree could be different from the one when nothing is
  671. * skipped. For this reason we skip at this place.
  672. IDONE = IDONE + NEWLST - NEWFST + 1
  673. GOTO 139
  674. ENDIF
  675. *
  676. * Compute RRR of child cluster.
  677. * Note that the new RRR is stored in Z
  678. *
  679. * DLARRF needs LWORK = 2*N
  680. CALL DLARRF( IN, D( IBEGIN ), L( IBEGIN ),
  681. $ WORK(INDLD+IBEGIN-1),
  682. $ NEWFST, NEWLST, WORK(WBEGIN),
  683. $ WGAP(WBEGIN), WERR(WBEGIN),
  684. $ SPDIAM, LGAP, RGAP, PIVMIN, TAU,
  685. $ Z(IBEGIN, NEWFTT),Z(IBEGIN, NEWFTT+1),
  686. $ WORK( INDWRK ), IINFO )
  687. IF( IINFO.EQ.0 ) THEN
  688. * a new RRR for the cluster was found by DLARRF
  689. * update shift and store it
  690. SSIGMA = SIGMA + TAU
  691. Z( IEND, NEWFTT+1 ) = SSIGMA
  692. * WORK() are the midpoints and WERR() the semi-width
  693. * Note that the entries in W are unchanged.
  694. DO 116 K = NEWFST, NEWLST
  695. FUDGE =
  696. $ THREE*EPS*ABS(WORK(WBEGIN+K-1))
  697. WORK( WBEGIN + K - 1 ) =
  698. $ WORK( WBEGIN + K - 1) - TAU
  699. FUDGE = FUDGE +
  700. $ FOUR*EPS*ABS(WORK(WBEGIN+K-1))
  701. * Fudge errors
  702. WERR( WBEGIN + K - 1 ) =
  703. $ WERR( WBEGIN + K - 1 ) + FUDGE
  704. * Gaps are not fudged. Provided that WERR is small
  705. * when eigenvalues are close, a zero gap indicates
  706. * that a new representation is needed for resolving
  707. * the cluster. A fudge could lead to a wrong decision
  708. * of judging eigenvalues 'separated' which in
  709. * reality are not. This could have a negative impact
  710. * on the orthogonality of the computed eigenvectors.
  711. 116 CONTINUE
  712. NCLUS = NCLUS + 1
  713. K = NEWCLS + 2*NCLUS
  714. IWORK( K-1 ) = NEWFST
  715. IWORK( K ) = NEWLST
  716. ELSE
  717. INFO = -2
  718. RETURN
  719. ENDIF
  720. ELSE
  721. *
  722. * Compute eigenvector of singleton
  723. *
  724. ITER = 0
  725. *
  726. TOL = FOUR * LOG(DBLE(IN)) * EPS
  727. *
  728. K = NEWFST
  729. WINDEX = WBEGIN + K - 1
  730. WINDMN = MAX(WINDEX - 1,1)
  731. WINDPL = MIN(WINDEX + 1,M)
  732. LAMBDA = WORK( WINDEX )
  733. DONE = DONE + 1
  734. * Check if eigenvector computation is to be skipped
  735. IF((WINDEX.LT.DOL).OR.
  736. $ (WINDEX.GT.DOU)) THEN
  737. ESKIP = .TRUE.
  738. GOTO 125
  739. ELSE
  740. ESKIP = .FALSE.
  741. ENDIF
  742. LEFT = WORK( WINDEX ) - WERR( WINDEX )
  743. RIGHT = WORK( WINDEX ) + WERR( WINDEX )
  744. INDEIG = INDEXW( WINDEX )
  745. * Note that since we compute the eigenpairs for a child,
  746. * all eigenvalue approximations are w.r.t the same shift.
  747. * In this case, the entries in WORK should be used for
  748. * computing the gaps since they exhibit even very small
  749. * differences in the eigenvalues, as opposed to the
  750. * entries in W which might "look" the same.
  751. IF( K .EQ. 1) THEN
  752. * In the case RANGE='I' and with not much initial
  753. * accuracy in LAMBDA and VL, the formula
  754. * LGAP = MAX( ZERO, (SIGMA - VL) + LAMBDA )
  755. * can lead to an overestimation of the left gap and
  756. * thus to inadequately early RQI 'convergence'.
  757. * Prevent this by forcing a small left gap.
  758. LGAP = EPS*MAX(ABS(LEFT),ABS(RIGHT))
  759. ELSE
  760. LGAP = WGAP(WINDMN)
  761. ENDIF
  762. IF( K .EQ. IM) THEN
  763. * In the case RANGE='I' and with not much initial
  764. * accuracy in LAMBDA and VU, the formula
  765. * can lead to an overestimation of the right gap and
  766. * thus to inadequately early RQI 'convergence'.
  767. * Prevent this by forcing a small right gap.
  768. RGAP = EPS*MAX(ABS(LEFT),ABS(RIGHT))
  769. ELSE
  770. RGAP = WGAP(WINDEX)
  771. ENDIF
  772. GAP = MIN( LGAP, RGAP )
  773. IF(( K .EQ. 1).OR.(K .EQ. IM)) THEN
  774. * The eigenvector support can become wrong
  775. * because significant entries could be cut off due to a
  776. * large GAPTOL parameter in LAR1V. Prevent this.
  777. GAPTOL = ZERO
  778. ELSE
  779. GAPTOL = GAP * EPS
  780. ENDIF
  781. ISUPMN = IN
  782. ISUPMX = 1
  783. * Update WGAP so that it holds the minimum gap
  784. * to the left or the right. This is crucial in the
  785. * case where bisection is used to ensure that the
  786. * eigenvalue is refined up to the required precision.
  787. * The correct value is restored afterwards.
  788. SAVGAP = WGAP(WINDEX)
  789. WGAP(WINDEX) = GAP
  790. * We want to use the Rayleigh Quotient Correction
  791. * as often as possible since it converges quadratically
  792. * when we are close enough to the desired eigenvalue.
  793. * However, the Rayleigh Quotient can have the wrong sign
  794. * and lead us away from the desired eigenvalue. In this
  795. * case, the best we can do is to use bisection.
  796. USEDBS = .FALSE.
  797. USEDRQ = .FALSE.
  798. * Bisection is initially turned off unless it is forced
  799. NEEDBS = .NOT.TRYRQC
  800. 120 CONTINUE
  801. * Check if bisection should be used to refine eigenvalue
  802. IF(NEEDBS) THEN
  803. * Take the bisection as new iterate
  804. USEDBS = .TRUE.
  805. ITMP1 = IWORK( IINDR+WINDEX )
  806. OFFSET = INDEXW( WBEGIN ) - 1
  807. CALL DLARRB( IN, D(IBEGIN),
  808. $ WORK(INDLLD+IBEGIN-1),INDEIG,INDEIG,
  809. $ ZERO, TWO*EPS, OFFSET,
  810. $ WORK(WBEGIN),WGAP(WBEGIN),
  811. $ WERR(WBEGIN),WORK( INDWRK ),
  812. $ IWORK( IINDWK ), PIVMIN, SPDIAM,
  813. $ ITMP1, IINFO )
  814. IF( IINFO.NE.0 ) THEN
  815. INFO = -3
  816. RETURN
  817. ENDIF
  818. LAMBDA = WORK( WINDEX )
  819. * Reset twist index from inaccurate LAMBDA to
  820. * force computation of true MINGMA
  821. IWORK( IINDR+WINDEX ) = 0
  822. ENDIF
  823. * Given LAMBDA, compute the eigenvector.
  824. CALL DLAR1V( IN, 1, IN, LAMBDA, D( IBEGIN ),
  825. $ L( IBEGIN ), WORK(INDLD+IBEGIN-1),
  826. $ WORK(INDLLD+IBEGIN-1),
  827. $ PIVMIN, GAPTOL, Z( IBEGIN, WINDEX ),
  828. $ .NOT.USEDBS, NEGCNT, ZTZ, MINGMA,
  829. $ IWORK( IINDR+WINDEX ), ISUPPZ( 2*WINDEX-1 ),
  830. $ NRMINV, RESID, RQCORR, WORK( INDWRK ) )
  831. IF(ITER .EQ. 0) THEN
  832. BSTRES = RESID
  833. BSTW = LAMBDA
  834. ELSEIF(RESID.LT.BSTRES) THEN
  835. BSTRES = RESID
  836. BSTW = LAMBDA
  837. ENDIF
  838. ISUPMN = MIN(ISUPMN,ISUPPZ( 2*WINDEX-1 ))
  839. ISUPMX = MAX(ISUPMX,ISUPPZ( 2*WINDEX ))
  840. ITER = ITER + 1
  841. * sin alpha <= |resid|/gap
  842. * Note that both the residual and the gap are
  843. * proportional to the matrix, so ||T|| doesn't play
  844. * a role in the quotient
  845. *
  846. * Convergence test for Rayleigh-Quotient iteration
  847. * (omitted when Bisection has been used)
  848. *
  849. IF( RESID.GT.TOL*GAP .AND. ABS( RQCORR ).GT.
  850. $ RQTOL*ABS( LAMBDA ) .AND. .NOT. USEDBS)
  851. $ THEN
  852. * We need to check that the RQCORR update doesn't
  853. * move the eigenvalue away from the desired one and
  854. * towards a neighbor. -> protection with bisection
  855. IF(INDEIG.LE.NEGCNT) THEN
  856. * The wanted eigenvalue lies to the left
  857. SGNDEF = -ONE
  858. ELSE
  859. * The wanted eigenvalue lies to the right
  860. SGNDEF = ONE
  861. ENDIF
  862. * We only use the RQCORR if it improves the
  863. * the iterate reasonably.
  864. IF( ( RQCORR*SGNDEF.GE.ZERO )
  865. $ .AND.( LAMBDA + RQCORR.LE. RIGHT)
  866. $ .AND.( LAMBDA + RQCORR.GE. LEFT)
  867. $ ) THEN
  868. USEDRQ = .TRUE.
  869. * Store new midpoint of bisection interval in WORK
  870. IF(SGNDEF.EQ.ONE) THEN
  871. * The current LAMBDA is on the left of the true
  872. * eigenvalue
  873. LEFT = LAMBDA
  874. * We prefer to assume that the error estimate
  875. * is correct. We could make the interval not
  876. * as a bracket but to be modified if the RQCORR
  877. * chooses to. In this case, the RIGHT side should
  878. * be modified as follows:
  879. * RIGHT = MAX(RIGHT, LAMBDA + RQCORR)
  880. ELSE
  881. * The current LAMBDA is on the right of the true
  882. * eigenvalue
  883. RIGHT = LAMBDA
  884. * See comment about assuming the error estimate is
  885. * correct above.
  886. * LEFT = MIN(LEFT, LAMBDA + RQCORR)
  887. ENDIF
  888. WORK( WINDEX ) =
  889. $ HALF * (RIGHT + LEFT)
  890. * Take RQCORR since it has the correct sign and
  891. * improves the iterate reasonably
  892. LAMBDA = LAMBDA + RQCORR
  893. * Update width of error interval
  894. WERR( WINDEX ) =
  895. $ HALF * (RIGHT-LEFT)
  896. ELSE
  897. NEEDBS = .TRUE.
  898. ENDIF
  899. IF(RIGHT-LEFT.LT.RQTOL*ABS(LAMBDA)) THEN
  900. * The eigenvalue is computed to bisection accuracy
  901. * compute eigenvector and stop
  902. USEDBS = .TRUE.
  903. GOTO 120
  904. ELSEIF( ITER.LT.MAXITR ) THEN
  905. GOTO 120
  906. ELSEIF( ITER.EQ.MAXITR ) THEN
  907. NEEDBS = .TRUE.
  908. GOTO 120
  909. ELSE
  910. INFO = 5
  911. RETURN
  912. END IF
  913. ELSE
  914. STP2II = .FALSE.
  915. IF(USEDRQ .AND. USEDBS .AND.
  916. $ BSTRES.LE.RESID) THEN
  917. LAMBDA = BSTW
  918. STP2II = .TRUE.
  919. ENDIF
  920. IF (STP2II) THEN
  921. * improve error angle by second step
  922. CALL DLAR1V( IN, 1, IN, LAMBDA,
  923. $ D( IBEGIN ), L( IBEGIN ),
  924. $ WORK(INDLD+IBEGIN-1),
  925. $ WORK(INDLLD+IBEGIN-1),
  926. $ PIVMIN, GAPTOL, Z( IBEGIN, WINDEX ),
  927. $ .NOT.USEDBS, NEGCNT, ZTZ, MINGMA,
  928. $ IWORK( IINDR+WINDEX ),
  929. $ ISUPPZ( 2*WINDEX-1 ),
  930. $ NRMINV, RESID, RQCORR, WORK( INDWRK ) )
  931. ENDIF
  932. WORK( WINDEX ) = LAMBDA
  933. END IF
  934. *
  935. * Compute FP-vector support w.r.t. whole matrix
  936. *
  937. ISUPPZ( 2*WINDEX-1 ) = ISUPPZ( 2*WINDEX-1 )+OLDIEN
  938. ISUPPZ( 2*WINDEX ) = ISUPPZ( 2*WINDEX )+OLDIEN
  939. ZFROM = ISUPPZ( 2*WINDEX-1 )
  940. ZTO = ISUPPZ( 2*WINDEX )
  941. ISUPMN = ISUPMN + OLDIEN
  942. ISUPMX = ISUPMX + OLDIEN
  943. * Ensure vector is ok if support in the RQI has changed
  944. IF(ISUPMN.LT.ZFROM) THEN
  945. DO 122 II = ISUPMN,ZFROM-1
  946. Z( II, WINDEX ) = ZERO
  947. 122 CONTINUE
  948. ENDIF
  949. IF(ISUPMX.GT.ZTO) THEN
  950. DO 123 II = ZTO+1,ISUPMX
  951. Z( II, WINDEX ) = ZERO
  952. 123 CONTINUE
  953. ENDIF
  954. CALL DSCAL( ZTO-ZFROM+1, NRMINV,
  955. $ Z( ZFROM, WINDEX ), 1 )
  956. 125 CONTINUE
  957. * Update W
  958. W( WINDEX ) = LAMBDA+SIGMA
  959. * Recompute the gaps on the left and right
  960. * But only allow them to become larger and not
  961. * smaller (which can only happen through "bad"
  962. * cancellation and doesn't reflect the theory
  963. * where the initial gaps are underestimated due
  964. * to WERR being too crude.)
  965. IF(.NOT.ESKIP) THEN
  966. IF( K.GT.1) THEN
  967. WGAP( WINDMN ) = MAX( WGAP(WINDMN),
  968. $ W(WINDEX)-WERR(WINDEX)
  969. $ - W(WINDMN)-WERR(WINDMN) )
  970. ENDIF
  971. IF( WINDEX.LT.WEND ) THEN
  972. WGAP( WINDEX ) = MAX( SAVGAP,
  973. $ W( WINDPL )-WERR( WINDPL )
  974. $ - W( WINDEX )-WERR( WINDEX) )
  975. ENDIF
  976. ENDIF
  977. IDONE = IDONE + 1
  978. ENDIF
  979. * here ends the code for the current child
  980. *
  981. 139 CONTINUE
  982. * Proceed to any remaining child nodes
  983. NEWFST = J + 1
  984. 140 CONTINUE
  985. 150 CONTINUE
  986. NDEPTH = NDEPTH + 1
  987. GO TO 40
  988. END IF
  989. IBEGIN = IEND + 1
  990. WBEGIN = WEND + 1
  991. 170 CONTINUE
  992. *
  993. RETURN
  994. *
  995. * End of DLARRV
  996. *
  997. END