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.

slarrv.f 43 kB

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