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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  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 September 2012
  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.4.2) --
  287. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  288. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  289. * September 2012
  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. * The first N entries of WORK are reserved for the eigenvalues
  343. INDLD = N+1
  344. INDLLD= 2*N+1
  345. INDWRK= 3*N+1
  346. MINWSIZE = 12 * N
  347. DO 5 I= 1,MINWSIZE
  348. WORK( I ) = ZERO
  349. 5 CONTINUE
  350. * IWORK(IINDR+1:IINDR+N) hold the twist indices R for the
  351. * factorization used to compute the FP vector
  352. IINDR = 0
  353. * IWORK(IINDC1+1:IINC2+N) are used to store the clusters of the current
  354. * layer and the one above.
  355. IINDC1 = N
  356. IINDC2 = 2*N
  357. IINDWK = 3*N + 1
  358. MINIWSIZE = 7 * N
  359. DO 10 I= 1,MINIWSIZE
  360. IWORK( I ) = 0
  361. 10 CONTINUE
  362. ZUSEDL = 1
  363. IF(DOL.GT.1) THEN
  364. * Set lower bound for use of Z
  365. ZUSEDL = DOL-1
  366. ENDIF
  367. ZUSEDU = M
  368. IF(DOU.LT.M) THEN
  369. * Set lower bound for use of Z
  370. ZUSEDU = DOU+1
  371. ENDIF
  372. * The width of the part of Z that is used
  373. ZUSEDW = ZUSEDU - ZUSEDL + 1
  374. CALL DLASET( 'Full', N, ZUSEDW, ZERO, ZERO,
  375. $ Z(1,ZUSEDL), LDZ )
  376. EPS = DLAMCH( 'Precision' )
  377. RQTOL = TWO * EPS
  378. *
  379. * Set expert flags for standard code.
  380. TRYRQC = .TRUE.
  381. IF((DOL.EQ.1).AND.(DOU.EQ.M)) THEN
  382. ELSE
  383. * Only selected eigenpairs are computed. Since the other evalues
  384. * are not refined by RQ iteration, bisection has to compute to full
  385. * accuracy.
  386. RTOL1 = FOUR * EPS
  387. RTOL2 = FOUR * EPS
  388. ENDIF
  389. * The entries WBEGIN:WEND in W, WERR, WGAP correspond to the
  390. * desired eigenvalues. The support of the nonzero eigenvector
  391. * entries is contained in the interval IBEGIN:IEND.
  392. * Remark that if k eigenpairs are desired, then the eigenvectors
  393. * are stored in k contiguous columns of Z.
  394. * DONE is the number of eigenvectors already computed
  395. DONE = 0
  396. IBEGIN = 1
  397. WBEGIN = 1
  398. DO 170 JBLK = 1, IBLOCK( M )
  399. IEND = ISPLIT( JBLK )
  400. SIGMA = L( IEND )
  401. * Find the eigenvectors of the submatrix indexed IBEGIN
  402. * through IEND.
  403. WEND = WBEGIN - 1
  404. 15 CONTINUE
  405. IF( WEND.LT.M ) THEN
  406. IF( IBLOCK( WEND+1 ).EQ.JBLK ) THEN
  407. WEND = WEND + 1
  408. GO TO 15
  409. END IF
  410. END IF
  411. IF( WEND.LT.WBEGIN ) THEN
  412. IBEGIN = IEND + 1
  413. GO TO 170
  414. ELSEIF( (WEND.LT.DOL).OR.(WBEGIN.GT.DOU) ) THEN
  415. IBEGIN = IEND + 1
  416. WBEGIN = WEND + 1
  417. GO TO 170
  418. END IF
  419. * Find local spectral diameter of the block
  420. GL = GERS( 2*IBEGIN-1 )
  421. GU = GERS( 2*IBEGIN )
  422. DO 20 I = IBEGIN+1 , IEND
  423. GL = MIN( GERS( 2*I-1 ), GL )
  424. GU = MAX( GERS( 2*I ), GU )
  425. 20 CONTINUE
  426. SPDIAM = GU - GL
  427. * OLDIEN is the last index of the previous block
  428. OLDIEN = IBEGIN - 1
  429. * Calculate the size of the current block
  430. IN = IEND - IBEGIN + 1
  431. * The number of eigenvalues in the current block
  432. IM = WEND - WBEGIN + 1
  433. * This is for a 1x1 block
  434. IF( IBEGIN.EQ.IEND ) THEN
  435. DONE = DONE+1
  436. Z( IBEGIN, WBEGIN ) = ONE
  437. ISUPPZ( 2*WBEGIN-1 ) = IBEGIN
  438. ISUPPZ( 2*WBEGIN ) = IBEGIN
  439. W( WBEGIN ) = W( WBEGIN ) + SIGMA
  440. WORK( WBEGIN ) = W( WBEGIN )
  441. IBEGIN = IEND + 1
  442. WBEGIN = WBEGIN + 1
  443. GO TO 170
  444. END IF
  445. * The desired (shifted) eigenvalues are stored in W(WBEGIN:WEND)
  446. * Note that these can be approximations, in this case, the corresp.
  447. * entries of WERR give the size of the uncertainty interval.
  448. * The eigenvalue approximations will be refined when necessary as
  449. * high relative accuracy is required for the computation of the
  450. * corresponding eigenvectors.
  451. CALL DCOPY( IM, W( WBEGIN ), 1,
  452. $ WORK( WBEGIN ), 1 )
  453. * We store in W the eigenvalue approximations w.r.t. the original
  454. * matrix T.
  455. DO 30 I=1,IM
  456. W(WBEGIN+I-1) = W(WBEGIN+I-1)+SIGMA
  457. 30 CONTINUE
  458. * NDEPTH is the current depth of the representation tree
  459. NDEPTH = 0
  460. * PARITY is either 1 or 0
  461. PARITY = 1
  462. * NCLUS is the number of clusters for the next level of the
  463. * representation tree, we start with NCLUS = 1 for the root
  464. NCLUS = 1
  465. IWORK( IINDC1+1 ) = 1
  466. IWORK( IINDC1+2 ) = IM
  467. * IDONE is the number of eigenvectors already computed in the current
  468. * block
  469. IDONE = 0
  470. * loop while( IDONE.LT.IM )
  471. * generate the representation tree for the current block and
  472. * compute the eigenvectors
  473. 40 CONTINUE
  474. IF( IDONE.LT.IM ) THEN
  475. * This is a crude protection against infinitely deep trees
  476. IF( NDEPTH.GT.M ) THEN
  477. INFO = -2
  478. RETURN
  479. ENDIF
  480. * breadth first processing of the current level of the representation
  481. * tree: OLDNCL = number of clusters on current level
  482. OLDNCL = NCLUS
  483. * reset NCLUS to count the number of child clusters
  484. NCLUS = 0
  485. *
  486. PARITY = 1 - PARITY
  487. IF( PARITY.EQ.0 ) THEN
  488. OLDCLS = IINDC1
  489. NEWCLS = IINDC2
  490. ELSE
  491. OLDCLS = IINDC2
  492. NEWCLS = IINDC1
  493. END IF
  494. * Process the clusters on the current level
  495. DO 150 I = 1, OLDNCL
  496. J = OLDCLS + 2*I
  497. * OLDFST, OLDLST = first, last index of current cluster.
  498. * cluster indices start with 1 and are relative
  499. * to WBEGIN when accessing W, WGAP, WERR, Z
  500. OLDFST = IWORK( J-1 )
  501. OLDLST = IWORK( J )
  502. IF( NDEPTH.GT.0 ) THEN
  503. * Retrieve relatively robust representation (RRR) of cluster
  504. * that has been computed at the previous level
  505. * The RRR is stored in Z and overwritten once the eigenvectors
  506. * have been computed or when the cluster is refined
  507. IF((DOL.EQ.1).AND.(DOU.EQ.M)) THEN
  508. * Get representation from location of the leftmost evalue
  509. * of the cluster
  510. J = WBEGIN + OLDFST - 1
  511. ELSE
  512. IF(WBEGIN+OLDFST-1.LT.DOL) THEN
  513. * Get representation from the left end of Z array
  514. J = DOL - 1
  515. ELSEIF(WBEGIN+OLDFST-1.GT.DOU) THEN
  516. * Get representation from the right end of Z array
  517. J = DOU
  518. ELSE
  519. J = WBEGIN + OLDFST - 1
  520. ENDIF
  521. ENDIF
  522. CALL DCOPY( IN, Z( IBEGIN, J ), 1, D( IBEGIN ), 1 )
  523. CALL DCOPY( IN-1, Z( IBEGIN, J+1 ), 1, L( IBEGIN ),
  524. $ 1 )
  525. SIGMA = Z( IEND, J+1 )
  526. * Set the corresponding entries in Z to zero
  527. CALL DLASET( 'Full', IN, 2, ZERO, ZERO,
  528. $ Z( IBEGIN, J), LDZ )
  529. END IF
  530. * Compute DL and DLL of current RRR
  531. DO 50 J = IBEGIN, IEND-1
  532. TMP = D( J )*L( J )
  533. WORK( INDLD-1+J ) = TMP
  534. WORK( INDLLD-1+J ) = TMP*L( J )
  535. 50 CONTINUE
  536. IF( NDEPTH.GT.0 ) THEN
  537. * P and Q are index of the first and last eigenvalue to compute
  538. * within the current block
  539. P = INDEXW( WBEGIN-1+OLDFST )
  540. Q = INDEXW( WBEGIN-1+OLDLST )
  541. * Offset for the arrays WORK, WGAP and WERR, i.e., the P-OFFSET
  542. * through the Q-OFFSET elements of these arrays are to be used.
  543. * OFFSET = P-OLDFST
  544. OFFSET = INDEXW( WBEGIN ) - 1
  545. * perform limited bisection (if necessary) to get approximate
  546. * eigenvalues to the precision needed.
  547. CALL DLARRB( IN, D( IBEGIN ),
  548. $ WORK(INDLLD+IBEGIN-1),
  549. $ P, Q, RTOL1, RTOL2, OFFSET,
  550. $ WORK(WBEGIN),WGAP(WBEGIN),WERR(WBEGIN),
  551. $ WORK( INDWRK ), IWORK( IINDWK ),
  552. $ PIVMIN, SPDIAM, IN, IINFO )
  553. IF( IINFO.NE.0 ) THEN
  554. INFO = -1
  555. RETURN
  556. ENDIF
  557. * We also recompute the extremal gaps. W holds all eigenvalues
  558. * of the unshifted matrix and must be used for computation
  559. * of WGAP, the entries of WORK might stem from RRRs with
  560. * different shifts. The gaps from WBEGIN-1+OLDFST to
  561. * WBEGIN-1+OLDLST are correctly computed in DLARRB.
  562. * However, we only allow the gaps to become greater since
  563. * this is what should happen when we decrease WERR
  564. IF( OLDFST.GT.1) THEN
  565. WGAP( WBEGIN+OLDFST-2 ) =
  566. $ MAX(WGAP(WBEGIN+OLDFST-2),
  567. $ W(WBEGIN+OLDFST-1)-WERR(WBEGIN+OLDFST-1)
  568. $ - W(WBEGIN+OLDFST-2)-WERR(WBEGIN+OLDFST-2) )
  569. ENDIF
  570. IF( WBEGIN + OLDLST -1 .LT. WEND ) THEN
  571. WGAP( WBEGIN+OLDLST-1 ) =
  572. $ MAX(WGAP(WBEGIN+OLDLST-1),
  573. $ W(WBEGIN+OLDLST)-WERR(WBEGIN+OLDLST)
  574. $ - W(WBEGIN+OLDLST-1)-WERR(WBEGIN+OLDLST-1) )
  575. ENDIF
  576. * Each time the eigenvalues in WORK get refined, we store
  577. * the newly found approximation with all shifts applied in W
  578. DO 53 J=OLDFST,OLDLST
  579. W(WBEGIN+J-1) = WORK(WBEGIN+J-1)+SIGMA
  580. 53 CONTINUE
  581. END IF
  582. * Process the current node.
  583. NEWFST = OLDFST
  584. DO 140 J = OLDFST, OLDLST
  585. IF( J.EQ.OLDLST ) THEN
  586. * we are at the right end of the cluster, this is also the
  587. * boundary of the child cluster
  588. NEWLST = J
  589. ELSE IF ( WGAP( WBEGIN + J -1).GE.
  590. $ MINRGP* ABS( WORK(WBEGIN + J -1) ) ) THEN
  591. * the right relative gap is big enough, the child cluster
  592. * (NEWFST,..,NEWLST) is well separated from the following
  593. NEWLST = J
  594. ELSE
  595. * inside a child cluster, the relative gap is not
  596. * big enough.
  597. GOTO 140
  598. END IF
  599. * Compute size of child cluster found
  600. NEWSIZ = NEWLST - NEWFST + 1
  601. * NEWFTT is the place in Z where the new RRR or the computed
  602. * eigenvector is to be stored
  603. IF((DOL.EQ.1).AND.(DOU.EQ.M)) THEN
  604. * Store representation at location of the leftmost evalue
  605. * of the cluster
  606. NEWFTT = WBEGIN + NEWFST - 1
  607. ELSE
  608. IF(WBEGIN+NEWFST-1.LT.DOL) THEN
  609. * Store representation at the left end of Z array
  610. NEWFTT = DOL - 1
  611. ELSEIF(WBEGIN+NEWFST-1.GT.DOU) THEN
  612. * Store representation at the right end of Z array
  613. NEWFTT = DOU
  614. ELSE
  615. NEWFTT = WBEGIN + NEWFST - 1
  616. ENDIF
  617. ENDIF
  618. IF( NEWSIZ.GT.1) THEN
  619. *
  620. * Current child is not a singleton but a cluster.
  621. * Compute and store new representation of child.
  622. *
  623. *
  624. * Compute left and right cluster gap.
  625. *
  626. * LGAP and RGAP are not computed from WORK because
  627. * the eigenvalue approximations may stem from RRRs
  628. * different shifts. However, W hold all eigenvalues
  629. * of the unshifted matrix. Still, the entries in WGAP
  630. * have to be computed from WORK since the entries
  631. * in W might be of the same order so that gaps are not
  632. * exhibited correctly for very close eigenvalues.
  633. IF( NEWFST.EQ.1 ) THEN
  634. LGAP = MAX( ZERO,
  635. $ W(WBEGIN)-WERR(WBEGIN) - VL )
  636. ELSE
  637. LGAP = WGAP( WBEGIN+NEWFST-2 )
  638. ENDIF
  639. RGAP = WGAP( WBEGIN+NEWLST-1 )
  640. *
  641. * Compute left- and rightmost eigenvalue of child
  642. * to high precision in order to shift as close
  643. * as possible and obtain as large relative gaps
  644. * as possible
  645. *
  646. DO 55 K =1,2
  647. IF(K.EQ.1) THEN
  648. P = INDEXW( WBEGIN-1+NEWFST )
  649. ELSE
  650. P = INDEXW( WBEGIN-1+NEWLST )
  651. ENDIF
  652. OFFSET = INDEXW( WBEGIN ) - 1
  653. CALL DLARRB( IN, D(IBEGIN),
  654. $ WORK( INDLLD+IBEGIN-1 ),P,P,
  655. $ RQTOL, RQTOL, OFFSET,
  656. $ WORK(WBEGIN),WGAP(WBEGIN),
  657. $ WERR(WBEGIN),WORK( INDWRK ),
  658. $ IWORK( IINDWK ), PIVMIN, SPDIAM,
  659. $ IN, IINFO )
  660. 55 CONTINUE
  661. *
  662. IF((WBEGIN+NEWLST-1.LT.DOL).OR.
  663. $ (WBEGIN+NEWFST-1.GT.DOU)) THEN
  664. * if the cluster contains no desired eigenvalues
  665. * skip the computation of that branch of the rep. tree
  666. *
  667. * We could skip before the refinement of the extremal
  668. * eigenvalues of the child, but then the representation
  669. * tree could be different from the one when nothing is
  670. * skipped. For this reason we skip at this place.
  671. IDONE = IDONE + NEWLST - NEWFST + 1
  672. GOTO 139
  673. ENDIF
  674. *
  675. * Compute RRR of child cluster.
  676. * Note that the new RRR is stored in Z
  677. *
  678. * DLARRF needs LWORK = 2*N
  679. CALL DLARRF( IN, D( IBEGIN ), L( IBEGIN ),
  680. $ WORK(INDLD+IBEGIN-1),
  681. $ NEWFST, NEWLST, WORK(WBEGIN),
  682. $ WGAP(WBEGIN), WERR(WBEGIN),
  683. $ SPDIAM, LGAP, RGAP, PIVMIN, TAU,
  684. $ Z(IBEGIN, NEWFTT),Z(IBEGIN, NEWFTT+1),
  685. $ WORK( INDWRK ), IINFO )
  686. IF( IINFO.EQ.0 ) THEN
  687. * a new RRR for the cluster was found by DLARRF
  688. * update shift and store it
  689. SSIGMA = SIGMA + TAU
  690. Z( IEND, NEWFTT+1 ) = SSIGMA
  691. * WORK() are the midpoints and WERR() the semi-width
  692. * Note that the entries in W are unchanged.
  693. DO 116 K = NEWFST, NEWLST
  694. FUDGE =
  695. $ THREE*EPS*ABS(WORK(WBEGIN+K-1))
  696. WORK( WBEGIN + K - 1 ) =
  697. $ WORK( WBEGIN + K - 1) - TAU
  698. FUDGE = FUDGE +
  699. $ FOUR*EPS*ABS(WORK(WBEGIN+K-1))
  700. * Fudge errors
  701. WERR( WBEGIN + K - 1 ) =
  702. $ WERR( WBEGIN + K - 1 ) + FUDGE
  703. * Gaps are not fudged. Provided that WERR is small
  704. * when eigenvalues are close, a zero gap indicates
  705. * that a new representation is needed for resolving
  706. * the cluster. A fudge could lead to a wrong decision
  707. * of judging eigenvalues 'separated' which in
  708. * reality are not. This could have a negative impact
  709. * on the orthogonality of the computed eigenvectors.
  710. 116 CONTINUE
  711. NCLUS = NCLUS + 1
  712. K = NEWCLS + 2*NCLUS
  713. IWORK( K-1 ) = NEWFST
  714. IWORK( K ) = NEWLST
  715. ELSE
  716. INFO = -2
  717. RETURN
  718. ENDIF
  719. ELSE
  720. *
  721. * Compute eigenvector of singleton
  722. *
  723. ITER = 0
  724. *
  725. TOL = FOUR * LOG(DBLE(IN)) * EPS
  726. *
  727. K = NEWFST
  728. WINDEX = WBEGIN + K - 1
  729. WINDMN = MAX(WINDEX - 1,1)
  730. WINDPL = MIN(WINDEX + 1,M)
  731. LAMBDA = WORK( WINDEX )
  732. DONE = DONE + 1
  733. * Check if eigenvector computation is to be skipped
  734. IF((WINDEX.LT.DOL).OR.
  735. $ (WINDEX.GT.DOU)) THEN
  736. ESKIP = .TRUE.
  737. GOTO 125
  738. ELSE
  739. ESKIP = .FALSE.
  740. ENDIF
  741. LEFT = WORK( WINDEX ) - WERR( WINDEX )
  742. RIGHT = WORK( WINDEX ) + WERR( WINDEX )
  743. INDEIG = INDEXW( WINDEX )
  744. * Note that since we compute the eigenpairs for a child,
  745. * all eigenvalue approximations are w.r.t the same shift.
  746. * In this case, the entries in WORK should be used for
  747. * computing the gaps since they exhibit even very small
  748. * differences in the eigenvalues, as opposed to the
  749. * entries in W which might "look" the same.
  750. IF( K .EQ. 1) THEN
  751. * In the case RANGE='I' and with not much initial
  752. * accuracy in LAMBDA and VL, the formula
  753. * LGAP = MAX( ZERO, (SIGMA - VL) + LAMBDA )
  754. * can lead to an overestimation of the left gap and
  755. * thus to inadequately early RQI 'convergence'.
  756. * Prevent this by forcing a small left gap.
  757. LGAP = EPS*MAX(ABS(LEFT),ABS(RIGHT))
  758. ELSE
  759. LGAP = WGAP(WINDMN)
  760. ENDIF
  761. IF( K .EQ. IM) THEN
  762. * In the case RANGE='I' and with not much initial
  763. * accuracy in LAMBDA and VU, the formula
  764. * can lead to an overestimation of the right gap and
  765. * thus to inadequately early RQI 'convergence'.
  766. * Prevent this by forcing a small right gap.
  767. RGAP = EPS*MAX(ABS(LEFT),ABS(RIGHT))
  768. ELSE
  769. RGAP = WGAP(WINDEX)
  770. ENDIF
  771. GAP = MIN( LGAP, RGAP )
  772. IF(( K .EQ. 1).OR.(K .EQ. IM)) THEN
  773. * The eigenvector support can become wrong
  774. * because significant entries could be cut off due to a
  775. * large GAPTOL parameter in LAR1V. Prevent this.
  776. GAPTOL = ZERO
  777. ELSE
  778. GAPTOL = GAP * EPS
  779. ENDIF
  780. ISUPMN = IN
  781. ISUPMX = 1
  782. * Update WGAP so that it holds the minimum gap
  783. * to the left or the right. This is crucial in the
  784. * case where bisection is used to ensure that the
  785. * eigenvalue is refined up to the required precision.
  786. * The correct value is restored afterwards.
  787. SAVGAP = WGAP(WINDEX)
  788. WGAP(WINDEX) = GAP
  789. * We want to use the Rayleigh Quotient Correction
  790. * as often as possible since it converges quadratically
  791. * when we are close enough to the desired eigenvalue.
  792. * However, the Rayleigh Quotient can have the wrong sign
  793. * and lead us away from the desired eigenvalue. In this
  794. * case, the best we can do is to use bisection.
  795. USEDBS = .FALSE.
  796. USEDRQ = .FALSE.
  797. * Bisection is initially turned off unless it is forced
  798. NEEDBS = .NOT.TRYRQC
  799. 120 CONTINUE
  800. * Check if bisection should be used to refine eigenvalue
  801. IF(NEEDBS) THEN
  802. * Take the bisection as new iterate
  803. USEDBS = .TRUE.
  804. ITMP1 = IWORK( IINDR+WINDEX )
  805. OFFSET = INDEXW( WBEGIN ) - 1
  806. CALL DLARRB( IN, D(IBEGIN),
  807. $ WORK(INDLLD+IBEGIN-1),INDEIG,INDEIG,
  808. $ ZERO, TWO*EPS, OFFSET,
  809. $ WORK(WBEGIN),WGAP(WBEGIN),
  810. $ WERR(WBEGIN),WORK( INDWRK ),
  811. $ IWORK( IINDWK ), PIVMIN, SPDIAM,
  812. $ ITMP1, IINFO )
  813. IF( IINFO.NE.0 ) THEN
  814. INFO = -3
  815. RETURN
  816. ENDIF
  817. LAMBDA = WORK( WINDEX )
  818. * Reset twist index from inaccurate LAMBDA to
  819. * force computation of true MINGMA
  820. IWORK( IINDR+WINDEX ) = 0
  821. ENDIF
  822. * Given LAMBDA, compute the eigenvector.
  823. CALL DLAR1V( IN, 1, IN, LAMBDA, D( IBEGIN ),
  824. $ L( IBEGIN ), WORK(INDLD+IBEGIN-1),
  825. $ WORK(INDLLD+IBEGIN-1),
  826. $ PIVMIN, GAPTOL, Z( IBEGIN, WINDEX ),
  827. $ .NOT.USEDBS, NEGCNT, ZTZ, MINGMA,
  828. $ IWORK( IINDR+WINDEX ), ISUPPZ( 2*WINDEX-1 ),
  829. $ NRMINV, RESID, RQCORR, WORK( INDWRK ) )
  830. IF(ITER .EQ. 0) THEN
  831. BSTRES = RESID
  832. BSTW = LAMBDA
  833. ELSEIF(RESID.LT.BSTRES) THEN
  834. BSTRES = RESID
  835. BSTW = LAMBDA
  836. ENDIF
  837. ISUPMN = MIN(ISUPMN,ISUPPZ( 2*WINDEX-1 ))
  838. ISUPMX = MAX(ISUPMX,ISUPPZ( 2*WINDEX ))
  839. ITER = ITER + 1
  840. * sin alpha <= |resid|/gap
  841. * Note that both the residual and the gap are
  842. * proportional to the matrix, so ||T|| doesn't play
  843. * a role in the quotient
  844. *
  845. * Convergence test for Rayleigh-Quotient iteration
  846. * (omitted when Bisection has been used)
  847. *
  848. IF( RESID.GT.TOL*GAP .AND. ABS( RQCORR ).GT.
  849. $ RQTOL*ABS( LAMBDA ) .AND. .NOT. USEDBS)
  850. $ THEN
  851. * We need to check that the RQCORR update doesn't
  852. * move the eigenvalue away from the desired one and
  853. * towards a neighbor. -> protection with bisection
  854. IF(INDEIG.LE.NEGCNT) THEN
  855. * The wanted eigenvalue lies to the left
  856. SGNDEF = -ONE
  857. ELSE
  858. * The wanted eigenvalue lies to the right
  859. SGNDEF = ONE
  860. ENDIF
  861. * We only use the RQCORR if it improves the
  862. * the iterate reasonably.
  863. IF( ( RQCORR*SGNDEF.GE.ZERO )
  864. $ .AND.( LAMBDA + RQCORR.LE. RIGHT)
  865. $ .AND.( LAMBDA + RQCORR.GE. LEFT)
  866. $ ) THEN
  867. USEDRQ = .TRUE.
  868. * Store new midpoint of bisection interval in WORK
  869. IF(SGNDEF.EQ.ONE) THEN
  870. * The current LAMBDA is on the left of the true
  871. * eigenvalue
  872. LEFT = LAMBDA
  873. * We prefer to assume that the error estimate
  874. * is correct. We could make the interval not
  875. * as a bracket but to be modified if the RQCORR
  876. * chooses to. In this case, the RIGHT side should
  877. * be modified as follows:
  878. * RIGHT = MAX(RIGHT, LAMBDA + RQCORR)
  879. ELSE
  880. * The current LAMBDA is on the right of the true
  881. * eigenvalue
  882. RIGHT = LAMBDA
  883. * See comment about assuming the error estimate is
  884. * correct above.
  885. * LEFT = MIN(LEFT, LAMBDA + RQCORR)
  886. ENDIF
  887. WORK( WINDEX ) =
  888. $ HALF * (RIGHT + LEFT)
  889. * Take RQCORR since it has the correct sign and
  890. * improves the iterate reasonably
  891. LAMBDA = LAMBDA + RQCORR
  892. * Update width of error interval
  893. WERR( WINDEX ) =
  894. $ HALF * (RIGHT-LEFT)
  895. ELSE
  896. NEEDBS = .TRUE.
  897. ENDIF
  898. IF(RIGHT-LEFT.LT.RQTOL*ABS(LAMBDA)) THEN
  899. * The eigenvalue is computed to bisection accuracy
  900. * compute eigenvector and stop
  901. USEDBS = .TRUE.
  902. GOTO 120
  903. ELSEIF( ITER.LT.MAXITR ) THEN
  904. GOTO 120
  905. ELSEIF( ITER.EQ.MAXITR ) THEN
  906. NEEDBS = .TRUE.
  907. GOTO 120
  908. ELSE
  909. INFO = 5
  910. RETURN
  911. END IF
  912. ELSE
  913. STP2II = .FALSE.
  914. IF(USEDRQ .AND. USEDBS .AND.
  915. $ BSTRES.LE.RESID) THEN
  916. LAMBDA = BSTW
  917. STP2II = .TRUE.
  918. ENDIF
  919. IF (STP2II) THEN
  920. * improve error angle by second step
  921. CALL DLAR1V( IN, 1, IN, LAMBDA,
  922. $ D( IBEGIN ), L( IBEGIN ),
  923. $ WORK(INDLD+IBEGIN-1),
  924. $ WORK(INDLLD+IBEGIN-1),
  925. $ PIVMIN, GAPTOL, Z( IBEGIN, WINDEX ),
  926. $ .NOT.USEDBS, NEGCNT, ZTZ, MINGMA,
  927. $ IWORK( IINDR+WINDEX ),
  928. $ ISUPPZ( 2*WINDEX-1 ),
  929. $ NRMINV, RESID, RQCORR, WORK( INDWRK ) )
  930. ENDIF
  931. WORK( WINDEX ) = LAMBDA
  932. END IF
  933. *
  934. * Compute FP-vector support w.r.t. whole matrix
  935. *
  936. ISUPPZ( 2*WINDEX-1 ) = ISUPPZ( 2*WINDEX-1 )+OLDIEN
  937. ISUPPZ( 2*WINDEX ) = ISUPPZ( 2*WINDEX )+OLDIEN
  938. ZFROM = ISUPPZ( 2*WINDEX-1 )
  939. ZTO = ISUPPZ( 2*WINDEX )
  940. ISUPMN = ISUPMN + OLDIEN
  941. ISUPMX = ISUPMX + OLDIEN
  942. * Ensure vector is ok if support in the RQI has changed
  943. IF(ISUPMN.LT.ZFROM) THEN
  944. DO 122 II = ISUPMN,ZFROM-1
  945. Z( II, WINDEX ) = ZERO
  946. 122 CONTINUE
  947. ENDIF
  948. IF(ISUPMX.GT.ZTO) THEN
  949. DO 123 II = ZTO+1,ISUPMX
  950. Z( II, WINDEX ) = ZERO
  951. 123 CONTINUE
  952. ENDIF
  953. CALL DSCAL( ZTO-ZFROM+1, NRMINV,
  954. $ Z( ZFROM, WINDEX ), 1 )
  955. 125 CONTINUE
  956. * Update W
  957. W( WINDEX ) = LAMBDA+SIGMA
  958. * Recompute the gaps on the left and right
  959. * But only allow them to become larger and not
  960. * smaller (which can only happen through "bad"
  961. * cancellation and doesn't reflect the theory
  962. * where the initial gaps are underestimated due
  963. * to WERR being too crude.)
  964. IF(.NOT.ESKIP) THEN
  965. IF( K.GT.1) THEN
  966. WGAP( WINDMN ) = MAX( WGAP(WINDMN),
  967. $ W(WINDEX)-WERR(WINDEX)
  968. $ - W(WINDMN)-WERR(WINDMN) )
  969. ENDIF
  970. IF( WINDEX.LT.WEND ) THEN
  971. WGAP( WINDEX ) = MAX( SAVGAP,
  972. $ W( WINDPL )-WERR( WINDPL )
  973. $ - W( WINDEX )-WERR( WINDEX) )
  974. ENDIF
  975. ENDIF
  976. IDONE = IDONE + 1
  977. ENDIF
  978. * here ends the code for the current child
  979. *
  980. 139 CONTINUE
  981. * Proceed to any remaining child nodes
  982. NEWFST = J + 1
  983. 140 CONTINUE
  984. 150 CONTINUE
  985. NDEPTH = NDEPTH + 1
  986. GO TO 40
  987. END IF
  988. IBEGIN = IEND + 1
  989. WBEGIN = WEND + 1
  990. 170 CONTINUE
  991. *
  992. RETURN
  993. *
  994. * End of DLARRV
  995. *
  996. END