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

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