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.

ddrgsx.f 36 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  1. *> \brief \b DDRGSX
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. * Definition:
  9. * ===========
  10. *
  11. * SUBROUTINE DDRGSX( NSIZE, NCMAX, THRESH, NIN, NOUT, A, LDA, B, AI,
  12. * BI, Z, Q, ALPHAR, ALPHAI, BETA, C, LDC, S,
  13. * WORK, LWORK, IWORK, LIWORK, BWORK, INFO )
  14. *
  15. * .. Scalar Arguments ..
  16. * INTEGER INFO, LDA, LDC, LIWORK, LWORK, NCMAX, NIN,
  17. * $ NOUT, NSIZE
  18. * DOUBLE PRECISION THRESH
  19. * ..
  20. * .. Array Arguments ..
  21. * LOGICAL BWORK( * )
  22. * INTEGER IWORK( * )
  23. * DOUBLE PRECISION A( LDA, * ), AI( LDA, * ), ALPHAI( * ),
  24. * $ ALPHAR( * ), B( LDA, * ), BETA( * ),
  25. * $ BI( LDA, * ), C( LDC, * ), Q( LDA, * ), S( * ),
  26. * $ WORK( * ), Z( LDA, * )
  27. * ..
  28. *
  29. *
  30. *> \par Purpose:
  31. * =============
  32. *>
  33. *> \verbatim
  34. *>
  35. *> DDRGSX checks the nonsymmetric generalized eigenvalue (Schur form)
  36. *> problem expert driver DGGESX.
  37. *>
  38. *> DGGESX factors A and B as Q S Z' and Q T Z', where ' means
  39. *> transpose, T is upper triangular, S is in generalized Schur form
  40. *> (block upper triangular, with 1x1 and 2x2 blocks on the diagonal,
  41. *> the 2x2 blocks corresponding to complex conjugate pairs of
  42. *> generalized eigenvalues), and Q and Z are orthogonal. It also
  43. *> computes the generalized eigenvalues (alpha(1),beta(1)), ...,
  44. *> (alpha(n),beta(n)). Thus, w(j) = alpha(j)/beta(j) is a root of the
  45. *> characteristic equation
  46. *>
  47. *> det( A - w(j) B ) = 0
  48. *>
  49. *> Optionally it also reorders the eigenvalues so that a selected
  50. *> cluster of eigenvalues appears in the leading diagonal block of the
  51. *> Schur forms; computes a reciprocal condition number for the average
  52. *> of the selected eigenvalues; and computes a reciprocal condition
  53. *> number for the right and left deflating subspaces corresponding to
  54. *> the selected eigenvalues.
  55. *>
  56. *> When DDRGSX is called with NSIZE > 0, five (5) types of built-in
  57. *> matrix pairs are used to test the routine DGGESX.
  58. *>
  59. *> When DDRGSX is called with NSIZE = 0, it reads in test matrix data
  60. *> to test DGGESX.
  61. *>
  62. *> For each matrix pair, the following tests will be performed and
  63. *> compared with the threshold THRESH except for the tests (7) and (9):
  64. *>
  65. *> (1) | A - Q S Z' | / ( |A| n ulp )
  66. *>
  67. *> (2) | B - Q T Z' | / ( |B| n ulp )
  68. *>
  69. *> (3) | I - QQ' | / ( n ulp )
  70. *>
  71. *> (4) | I - ZZ' | / ( n ulp )
  72. *>
  73. *> (5) if A is in Schur form (i.e. quasi-triangular form)
  74. *>
  75. *> (6) maximum over j of D(j) where:
  76. *>
  77. *> if alpha(j) is real:
  78. *> |alpha(j) - S(j,j)| |beta(j) - T(j,j)|
  79. *> D(j) = ------------------------ + -----------------------
  80. *> max(|alpha(j)|,|S(j,j)|) max(|beta(j)|,|T(j,j)|)
  81. *>
  82. *> if alpha(j) is complex:
  83. *> | det( s S - w T ) |
  84. *> D(j) = ---------------------------------------------------
  85. *> ulp max( s norm(S), |w| norm(T) )*norm( s S - w T )
  86. *>
  87. *> and S and T are here the 2 x 2 diagonal blocks of S and T
  88. *> corresponding to the j-th and j+1-th eigenvalues.
  89. *>
  90. *> (7) if sorting worked and SDIM is the number of eigenvalues
  91. *> which were selected.
  92. *>
  93. *> (8) the estimated value DIF does not differ from the true values of
  94. *> Difu and Difl more than a factor 10*THRESH. If the estimate DIF
  95. *> equals zero the corresponding true values of Difu and Difl
  96. *> should be less than EPS*norm(A, B). If the true value of Difu
  97. *> and Difl equal zero, the estimate DIF should be less than
  98. *> EPS*norm(A, B).
  99. *>
  100. *> (9) If INFO = N+3 is returned by DGGESX, the reordering "failed"
  101. *> and we check that DIF = PL = PR = 0 and that the true value of
  102. *> Difu and Difl is < EPS*norm(A, B). We count the events when
  103. *> INFO=N+3.
  104. *>
  105. *> For read-in test matrices, the above tests are run except that the
  106. *> exact value for DIF (and PL) is input data. Additionally, there is
  107. *> one more test run for read-in test matrices:
  108. *>
  109. *> (10) the estimated value PL does not differ from the true value of
  110. *> PLTRU more than a factor THRESH. If the estimate PL equals
  111. *> zero the corresponding true value of PLTRU should be less than
  112. *> EPS*norm(A, B). If the true value of PLTRU equal zero, the
  113. *> estimate PL should be less than EPS*norm(A, B).
  114. *>
  115. *> Note that for the built-in tests, a total of 10*NSIZE*(NSIZE-1)
  116. *> matrix pairs are generated and tested. NSIZE should be kept small.
  117. *>
  118. *> SVD (routine DGESVD) is used for computing the true value of DIF_u
  119. *> and DIF_l when testing the built-in test problems.
  120. *>
  121. *> Built-in Test Matrices
  122. *> ======================
  123. *>
  124. *> All built-in test matrices are the 2 by 2 block of triangular
  125. *> matrices
  126. *>
  127. *> A = [ A11 A12 ] and B = [ B11 B12 ]
  128. *> [ A22 ] [ B22 ]
  129. *>
  130. *> where for different type of A11 and A22 are given as the following.
  131. *> A12 and B12 are chosen so that the generalized Sylvester equation
  132. *>
  133. *> A11*R - L*A22 = -A12
  134. *> B11*R - L*B22 = -B12
  135. *>
  136. *> have prescribed solution R and L.
  137. *>
  138. *> Type 1: A11 = J_m(1,-1) and A_22 = J_k(1-a,1).
  139. *> B11 = I_m, B22 = I_k
  140. *> where J_k(a,b) is the k-by-k Jordan block with ``a'' on
  141. *> diagonal and ``b'' on superdiagonal.
  142. *>
  143. *> Type 2: A11 = (a_ij) = ( 2(.5-sin(i)) ) and
  144. *> B11 = (b_ij) = ( 2(.5-sin(ij)) ) for i=1,...,m, j=i,...,m
  145. *> A22 = (a_ij) = ( 2(.5-sin(i+j)) ) and
  146. *> B22 = (b_ij) = ( 2(.5-sin(ij)) ) for i=m+1,...,k, j=i,...,k
  147. *>
  148. *> Type 3: A11, A22 and B11, B22 are chosen as for Type 2, but each
  149. *> second diagonal block in A_11 and each third diagonal block
  150. *> in A_22 are made as 2 by 2 blocks.
  151. *>
  152. *> Type 4: A11 = ( 20(.5 - sin(ij)) ) and B22 = ( 2(.5 - sin(i+j)) )
  153. *> for i=1,...,m, j=1,...,m and
  154. *> A22 = ( 20(.5 - sin(i+j)) ) and B22 = ( 2(.5 - sin(ij)) )
  155. *> for i=m+1,...,k, j=m+1,...,k
  156. *>
  157. *> Type 5: (A,B) and have potentially close or common eigenvalues and
  158. *> very large departure from block diagonality A_11 is chosen
  159. *> as the m x m leading submatrix of A_1:
  160. *> | 1 b |
  161. *> | -b 1 |
  162. *> | 1+d b |
  163. *> | -b 1+d |
  164. *> A_1 = | d 1 |
  165. *> | -1 d |
  166. *> | -d 1 |
  167. *> | -1 -d |
  168. *> | 1 |
  169. *> and A_22 is chosen as the k x k leading submatrix of A_2:
  170. *> | -1 b |
  171. *> | -b -1 |
  172. *> | 1-d b |
  173. *> | -b 1-d |
  174. *> A_2 = | d 1+b |
  175. *> | -1-b d |
  176. *> | -d 1+b |
  177. *> | -1+b -d |
  178. *> | 1-d |
  179. *> and matrix B are chosen as identity matrices (see DLATM5).
  180. *>
  181. *> \endverbatim
  182. *
  183. * Arguments:
  184. * ==========
  185. *
  186. *> \param[in] NSIZE
  187. *> \verbatim
  188. *> NSIZE is INTEGER
  189. *> The maximum size of the matrices to use. NSIZE >= 0.
  190. *> If NSIZE = 0, no built-in tests matrices are used, but
  191. *> read-in test matrices are used to test DGGESX.
  192. *> \endverbatim
  193. *>
  194. *> \param[in] NCMAX
  195. *> \verbatim
  196. *> NCMAX is INTEGER
  197. *> Maximum allowable NMAX for generating Kroneker matrix
  198. *> in call to DLAKF2
  199. *> \endverbatim
  200. *>
  201. *> \param[in] THRESH
  202. *> \verbatim
  203. *> THRESH is DOUBLE PRECISION
  204. *> A test will count as "failed" if the "error", computed as
  205. *> described above, exceeds THRESH. Note that the error
  206. *> is scaled to be O(1), so THRESH should be a reasonably
  207. *> small multiple of 1, e.g., 10 or 100. In particular,
  208. *> it should not depend on the precision (single vs. double)
  209. *> or the size of the matrix. THRESH >= 0.
  210. *> \endverbatim
  211. *>
  212. *> \param[in] NIN
  213. *> \verbatim
  214. *> NIN is INTEGER
  215. *> The FORTRAN unit number for reading in the data file of
  216. *> problems to solve.
  217. *> \endverbatim
  218. *>
  219. *> \param[in] NOUT
  220. *> \verbatim
  221. *> NOUT is INTEGER
  222. *> The FORTRAN unit number for printing out error messages
  223. *> (e.g., if a routine returns IINFO not equal to 0.)
  224. *> \endverbatim
  225. *>
  226. *> \param[out] A
  227. *> \verbatim
  228. *> A is DOUBLE PRECISION array, dimension (LDA, NSIZE)
  229. *> Used to store the matrix whose eigenvalues are to be
  230. *> computed. On exit, A contains the last matrix actually used.
  231. *> \endverbatim
  232. *>
  233. *> \param[in] LDA
  234. *> \verbatim
  235. *> LDA is INTEGER
  236. *> The leading dimension of A, B, AI, BI, Z and Q,
  237. *> LDA >= max( 1, NSIZE ). For the read-in test,
  238. *> LDA >= max( 1, N ), N is the size of the test matrices.
  239. *> \endverbatim
  240. *>
  241. *> \param[out] B
  242. *> \verbatim
  243. *> B is DOUBLE PRECISION array, dimension (LDA, NSIZE)
  244. *> Used to store the matrix whose eigenvalues are to be
  245. *> computed. On exit, B contains the last matrix actually used.
  246. *> \endverbatim
  247. *>
  248. *> \param[out] AI
  249. *> \verbatim
  250. *> AI is DOUBLE PRECISION array, dimension (LDA, NSIZE)
  251. *> Copy of A, modified by DGGESX.
  252. *> \endverbatim
  253. *>
  254. *> \param[out] BI
  255. *> \verbatim
  256. *> BI is DOUBLE PRECISION array, dimension (LDA, NSIZE)
  257. *> Copy of B, modified by DGGESX.
  258. *> \endverbatim
  259. *>
  260. *> \param[out] Z
  261. *> \verbatim
  262. *> Z is DOUBLE PRECISION array, dimension (LDA, NSIZE)
  263. *> Z holds the left Schur vectors computed by DGGESX.
  264. *> \endverbatim
  265. *>
  266. *> \param[out] Q
  267. *> \verbatim
  268. *> Q is DOUBLE PRECISION array, dimension (LDA, NSIZE)
  269. *> Q holds the right Schur vectors computed by DGGESX.
  270. *> \endverbatim
  271. *>
  272. *> \param[out] ALPHAR
  273. *> \verbatim
  274. *> ALPHAR is DOUBLE PRECISION array, dimension (NSIZE)
  275. *> \endverbatim
  276. *>
  277. *> \param[out] ALPHAI
  278. *> \verbatim
  279. *> ALPHAI is DOUBLE PRECISION array, dimension (NSIZE)
  280. *> \endverbatim
  281. *>
  282. *> \param[out] BETA
  283. *> \verbatim
  284. *> BETA is DOUBLE PRECISION array, dimension (NSIZE)
  285. *>
  286. *> On exit, (ALPHAR + ALPHAI*i)/BETA are the eigenvalues.
  287. *> \endverbatim
  288. *>
  289. *> \param[out] C
  290. *> \verbatim
  291. *> C is DOUBLE PRECISION array, dimension (LDC, LDC)
  292. *> Store the matrix generated by subroutine DLAKF2, this is the
  293. *> matrix formed by Kronecker products used for estimating
  294. *> DIF.
  295. *> \endverbatim
  296. *>
  297. *> \param[in] LDC
  298. *> \verbatim
  299. *> LDC is INTEGER
  300. *> The leading dimension of C. LDC >= max(1, LDA*LDA/2 ).
  301. *> \endverbatim
  302. *>
  303. *> \param[out] S
  304. *> \verbatim
  305. *> S is DOUBLE PRECISION array, dimension (LDC)
  306. *> Singular values of C
  307. *> \endverbatim
  308. *>
  309. *> \param[out] WORK
  310. *> \verbatim
  311. *> WORK is DOUBLE PRECISION array, dimension (LWORK)
  312. *> \endverbatim
  313. *>
  314. *> \param[in] LWORK
  315. *> \verbatim
  316. *> LWORK is INTEGER
  317. *> The dimension of the array WORK.
  318. *> LWORK >= MAX( 5*NSIZE*NSIZE/2 - 2, 10*(NSIZE+1) )
  319. *> \endverbatim
  320. *>
  321. *> \param[out] IWORK
  322. *> \verbatim
  323. *> IWORK is INTEGER array, dimension (LIWORK)
  324. *> \endverbatim
  325. *>
  326. *> \param[in] LIWORK
  327. *> \verbatim
  328. *> LIWORK is INTEGER
  329. *> The dimension of the array IWORK. LIWORK >= NSIZE + 6.
  330. *> \endverbatim
  331. *>
  332. *> \param[out] BWORK
  333. *> \verbatim
  334. *> BWORK is LOGICAL array, dimension (LDA)
  335. *> \endverbatim
  336. *>
  337. *> \param[out] INFO
  338. *> \verbatim
  339. *> INFO is INTEGER
  340. *> = 0: successful exit
  341. *> < 0: if INFO = -i, the i-th argument had an illegal value.
  342. *> > 0: A routine returned an error code.
  343. *> \endverbatim
  344. *
  345. * Authors:
  346. * ========
  347. *
  348. *> \author Univ. of Tennessee
  349. *> \author Univ. of California Berkeley
  350. *> \author Univ. of Colorado Denver
  351. *> \author NAG Ltd.
  352. *
  353. *> \ingroup double_eig
  354. *
  355. * =====================================================================
  356. SUBROUTINE DDRGSX( NSIZE, NCMAX, THRESH, NIN, NOUT, A, LDA, B, AI,
  357. $ BI, Z, Q, ALPHAR, ALPHAI, BETA, C, LDC, S,
  358. $ WORK, LWORK, IWORK, LIWORK, BWORK, INFO )
  359. *
  360. * -- LAPACK test routine --
  361. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  362. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  363. *
  364. * .. Scalar Arguments ..
  365. INTEGER INFO, LDA, LDC, LIWORK, LWORK, NCMAX, NIN,
  366. $ NOUT, NSIZE
  367. DOUBLE PRECISION THRESH
  368. * ..
  369. * .. Array Arguments ..
  370. LOGICAL BWORK( * )
  371. INTEGER IWORK( * )
  372. DOUBLE PRECISION A( LDA, * ), AI( LDA, * ), ALPHAI( * ),
  373. $ ALPHAR( * ), B( LDA, * ), BETA( * ),
  374. $ BI( LDA, * ), C( LDC, * ), Q( LDA, * ), S( * ),
  375. $ WORK( * ), Z( LDA, * )
  376. * ..
  377. *
  378. * =====================================================================
  379. *
  380. * .. Parameters ..
  381. DOUBLE PRECISION ZERO, ONE, TEN
  382. PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0, TEN = 1.0D+1 )
  383. * ..
  384. * .. Local Scalars ..
  385. LOGICAL ILABAD
  386. CHARACTER SENSE
  387. INTEGER BDSPAC, I, I1, IFUNC, IINFO, J, LINFO, MAXWRK,
  388. $ MINWRK, MM, MN2, NERRS, NPTKNT, NTEST, NTESTT,
  389. $ PRTYPE, QBA, QBB
  390. DOUBLE PRECISION ABNRM, BIGNUM, DIFTRU, PLTRU, SMLNUM, TEMP1,
  391. $ TEMP2, THRSH2, ULP, ULPINV, WEIGHT
  392. * ..
  393. * .. Local Arrays ..
  394. DOUBLE PRECISION DIFEST( 2 ), PL( 2 ), RESULT( 10 )
  395. * ..
  396. * .. External Functions ..
  397. LOGICAL DLCTSX
  398. INTEGER ILAENV
  399. DOUBLE PRECISION DLAMCH, DLANGE
  400. EXTERNAL DLCTSX, ILAENV, DLAMCH, DLANGE
  401. * ..
  402. * .. External Subroutines ..
  403. EXTERNAL ALASVM, DGESVD, DGET51, DGET53, DGGESX,
  404. $ DLACPY, DLAKF2, DLASET, DLATM5, XERBLA
  405. * ..
  406. * .. Intrinsic Functions ..
  407. INTRINSIC ABS, MAX, SQRT
  408. * ..
  409. * .. Scalars in Common ..
  410. LOGICAL FS
  411. INTEGER K, M, MPLUSN, N
  412. * ..
  413. * .. Common blocks ..
  414. COMMON / MN / M, N, MPLUSN, K, FS
  415. * ..
  416. * .. Executable Statements ..
  417. *
  418. * Check for errors
  419. *
  420. IF( NSIZE.LT.0 ) THEN
  421. INFO = -1
  422. ELSE IF( THRESH.LT.ZERO ) THEN
  423. INFO = -2
  424. ELSE IF( NIN.LE.0 ) THEN
  425. INFO = -3
  426. ELSE IF( NOUT.LE.0 ) THEN
  427. INFO = -4
  428. ELSE IF( LDA.LT.1 .OR. LDA.LT.NSIZE ) THEN
  429. INFO = -6
  430. ELSE IF( LDC.LT.1 .OR. LDC.LT.NSIZE*NSIZE / 2 ) THEN
  431. INFO = -17
  432. ELSE IF( LIWORK.LT.NSIZE+6 ) THEN
  433. INFO = -21
  434. END IF
  435. *
  436. * Compute workspace
  437. * (Note: Comments in the code beginning "Workspace:" describe the
  438. * minimal amount of workspace needed at that point in the code,
  439. * as well as the preferred amount for good performance.
  440. * NB refers to the optimal block size for the immediately
  441. * following subroutine, as returned by ILAENV.)
  442. *
  443. MINWRK = 1
  444. IF( INFO.EQ.0 .AND. LWORK.GE.1 ) THEN
  445. MINWRK = MAX( 10*( NSIZE+1 ), 5*NSIZE*NSIZE / 2 )
  446. *
  447. * workspace for sggesx
  448. *
  449. MAXWRK = 9*( NSIZE+1 ) + NSIZE*
  450. $ ILAENV( 1, 'DGEQRF', ' ', NSIZE, 1, NSIZE, 0 )
  451. MAXWRK = MAX( MAXWRK, 9*( NSIZE+1 )+NSIZE*
  452. $ ILAENV( 1, 'DORGQR', ' ', NSIZE, 1, NSIZE, -1 ) )
  453. *
  454. * workspace for dgesvd
  455. *
  456. BDSPAC = 5*NSIZE*NSIZE / 2
  457. MAXWRK = MAX( MAXWRK, 3*NSIZE*NSIZE / 2+NSIZE*NSIZE*
  458. $ ILAENV( 1, 'DGEBRD', ' ', NSIZE*NSIZE / 2,
  459. $ NSIZE*NSIZE / 2, -1, -1 ) )
  460. MAXWRK = MAX( MAXWRK, BDSPAC )
  461. *
  462. MAXWRK = MAX( MAXWRK, MINWRK )
  463. *
  464. WORK( 1 ) = MAXWRK
  465. END IF
  466. *
  467. IF( LWORK.LT.MINWRK )
  468. $ INFO = -19
  469. *
  470. IF( INFO.NE.0 ) THEN
  471. CALL XERBLA( 'DDRGSX', -INFO )
  472. RETURN
  473. END IF
  474. *
  475. * Important constants
  476. *
  477. ULP = DLAMCH( 'P' )
  478. ULPINV = ONE / ULP
  479. SMLNUM = DLAMCH( 'S' ) / ULP
  480. BIGNUM = ONE / SMLNUM
  481. THRSH2 = TEN*THRESH
  482. NTESTT = 0
  483. NERRS = 0
  484. *
  485. * Go to the tests for read-in matrix pairs
  486. *
  487. IFUNC = 0
  488. IF( NSIZE.EQ.0 )
  489. $ GO TO 70
  490. *
  491. * Test the built-in matrix pairs.
  492. * Loop over different functions (IFUNC) of DGGESX, types (PRTYPE)
  493. * of test matrices, different size (M+N)
  494. *
  495. PRTYPE = 0
  496. QBA = 3
  497. QBB = 4
  498. WEIGHT = SQRT( ULP )
  499. *
  500. DO 60 IFUNC = 0, 3
  501. DO 50 PRTYPE = 1, 5
  502. DO 40 M = 1, NSIZE - 1
  503. DO 30 N = 1, NSIZE - M
  504. *
  505. WEIGHT = ONE / WEIGHT
  506. MPLUSN = M + N
  507. *
  508. * Generate test matrices
  509. *
  510. FS = .TRUE.
  511. K = 0
  512. *
  513. CALL DLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, AI,
  514. $ LDA )
  515. CALL DLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, BI,
  516. $ LDA )
  517. *
  518. CALL DLATM5( PRTYPE, M, N, AI, LDA, AI( M+1, M+1 ),
  519. $ LDA, AI( 1, M+1 ), LDA, BI, LDA,
  520. $ BI( M+1, M+1 ), LDA, BI( 1, M+1 ), LDA,
  521. $ Q, LDA, Z, LDA, WEIGHT, QBA, QBB )
  522. *
  523. * Compute the Schur factorization and swapping the
  524. * m-by-m (1,1)-blocks with n-by-n (2,2)-blocks.
  525. * Swapping is accomplished via the function DLCTSX
  526. * which is supplied below.
  527. *
  528. IF( IFUNC.EQ.0 ) THEN
  529. SENSE = 'N'
  530. ELSE IF( IFUNC.EQ.1 ) THEN
  531. SENSE = 'E'
  532. ELSE IF( IFUNC.EQ.2 ) THEN
  533. SENSE = 'V'
  534. ELSE IF( IFUNC.EQ.3 ) THEN
  535. SENSE = 'B'
  536. END IF
  537. *
  538. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
  539. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
  540. *
  541. CALL DGGESX( 'V', 'V', 'S', DLCTSX, SENSE, MPLUSN, AI,
  542. $ LDA, BI, LDA, MM, ALPHAR, ALPHAI, BETA,
  543. $ Q, LDA, Z, LDA, PL, DIFEST, WORK, LWORK,
  544. $ IWORK, LIWORK, BWORK, LINFO )
  545. *
  546. IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
  547. RESULT( 1 ) = ULPINV
  548. WRITE( NOUT, FMT = 9999 )'DGGESX', LINFO, MPLUSN,
  549. $ PRTYPE
  550. INFO = LINFO
  551. GO TO 30
  552. END IF
  553. *
  554. * Compute the norm(A, B)
  555. *
  556. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK,
  557. $ MPLUSN )
  558. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
  559. $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
  560. ABNRM = DLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN,
  561. $ WORK )
  562. *
  563. * Do tests (1) to (4)
  564. *
  565. CALL DGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z,
  566. $ LDA, WORK, RESULT( 1 ) )
  567. CALL DGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z,
  568. $ LDA, WORK, RESULT( 2 ) )
  569. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q,
  570. $ LDA, WORK, RESULT( 3 ) )
  571. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z,
  572. $ LDA, WORK, RESULT( 4 ) )
  573. NTEST = 4
  574. *
  575. * Do tests (5) and (6): check Schur form of A and
  576. * compare eigenvalues with diagonals.
  577. *
  578. TEMP1 = ZERO
  579. RESULT( 5 ) = ZERO
  580. RESULT( 6 ) = ZERO
  581. *
  582. DO 10 J = 1, MPLUSN
  583. ILABAD = .FALSE.
  584. IF( ALPHAI( J ).EQ.ZERO ) THEN
  585. TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
  586. $ MAX( SMLNUM, ABS( ALPHAR( J ) ),
  587. $ ABS( AI( J, J ) ) )+
  588. $ ABS( BETA( J )-BI( J, J ) ) /
  589. $ MAX( SMLNUM, ABS( BETA( J ) ),
  590. $ ABS( BI( J, J ) ) ) ) / ULP
  591. IF( J.LT.MPLUSN ) THEN
  592. IF( AI( J+1, J ).NE.ZERO ) THEN
  593. ILABAD = .TRUE.
  594. RESULT( 5 ) = ULPINV
  595. END IF
  596. END IF
  597. IF( J.GT.1 ) THEN
  598. IF( AI( J, J-1 ).NE.ZERO ) THEN
  599. ILABAD = .TRUE.
  600. RESULT( 5 ) = ULPINV
  601. END IF
  602. END IF
  603. ELSE
  604. IF( ALPHAI( J ).GT.ZERO ) THEN
  605. I1 = J
  606. ELSE
  607. I1 = J - 1
  608. END IF
  609. IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
  610. ILABAD = .TRUE.
  611. ELSE IF( I1.LT.MPLUSN-1 ) THEN
  612. IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
  613. ILABAD = .TRUE.
  614. RESULT( 5 ) = ULPINV
  615. END IF
  616. ELSE IF( I1.GT.1 ) THEN
  617. IF( AI( I1, I1-1 ).NE.ZERO ) THEN
  618. ILABAD = .TRUE.
  619. RESULT( 5 ) = ULPINV
  620. END IF
  621. END IF
  622. IF( .NOT.ILABAD ) THEN
  623. CALL DGET53( AI( I1, I1 ), LDA, BI( I1, I1 ),
  624. $ LDA, BETA( J ), ALPHAR( J ),
  625. $ ALPHAI( J ), TEMP2, IINFO )
  626. IF( IINFO.GE.3 ) THEN
  627. WRITE( NOUT, FMT = 9997 )IINFO, J,
  628. $ MPLUSN, PRTYPE
  629. INFO = ABS( IINFO )
  630. END IF
  631. ELSE
  632. TEMP2 = ULPINV
  633. END IF
  634. END IF
  635. TEMP1 = MAX( TEMP1, TEMP2 )
  636. IF( ILABAD ) THEN
  637. WRITE( NOUT, FMT = 9996 )J, MPLUSN, PRTYPE
  638. END IF
  639. 10 CONTINUE
  640. RESULT( 6 ) = TEMP1
  641. NTEST = NTEST + 2
  642. *
  643. * Test (7) (if sorting worked)
  644. *
  645. RESULT( 7 ) = ZERO
  646. IF( LINFO.EQ.MPLUSN+3 ) THEN
  647. RESULT( 7 ) = ULPINV
  648. ELSE IF( MM.NE.N ) THEN
  649. RESULT( 7 ) = ULPINV
  650. END IF
  651. NTEST = NTEST + 1
  652. *
  653. * Test (8): compare the estimated value DIF and its
  654. * value. first, compute the exact DIF.
  655. *
  656. RESULT( 8 ) = ZERO
  657. MN2 = MM*( MPLUSN-MM )*2
  658. IF( IFUNC.GE.2 .AND. MN2.LE.NCMAX*NCMAX ) THEN
  659. *
  660. * Note: for either following two causes, there are
  661. * almost same number of test cases fail the test.
  662. *
  663. CALL DLAKF2( MM, MPLUSN-MM, AI, LDA,
  664. $ AI( MM+1, MM+1 ), BI,
  665. $ BI( MM+1, MM+1 ), C, LDC )
  666. *
  667. CALL DGESVD( 'N', 'N', MN2, MN2, C, LDC, S, WORK,
  668. $ 1, WORK( 2 ), 1, WORK( 3 ), LWORK-2,
  669. $ INFO )
  670. DIFTRU = S( MN2 )
  671. *
  672. IF( DIFEST( 2 ).EQ.ZERO ) THEN
  673. IF( DIFTRU.GT.ABNRM*ULP )
  674. $ RESULT( 8 ) = ULPINV
  675. ELSE IF( DIFTRU.EQ.ZERO ) THEN
  676. IF( DIFEST( 2 ).GT.ABNRM*ULP )
  677. $ RESULT( 8 ) = ULPINV
  678. ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
  679. $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
  680. RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ),
  681. $ DIFEST( 2 ) / DIFTRU )
  682. END IF
  683. NTEST = NTEST + 1
  684. END IF
  685. *
  686. * Test (9)
  687. *
  688. RESULT( 9 ) = ZERO
  689. IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
  690. IF( DIFTRU.GT.ABNRM*ULP )
  691. $ RESULT( 9 ) = ULPINV
  692. IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
  693. $ RESULT( 9 ) = ULPINV
  694. IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
  695. $ RESULT( 9 ) = ULPINV
  696. NTEST = NTEST + 1
  697. END IF
  698. *
  699. NTESTT = NTESTT + NTEST
  700. *
  701. * Print out tests which fail.
  702. *
  703. DO 20 J = 1, 9
  704. IF( RESULT( J ).GE.THRESH ) THEN
  705. *
  706. * If this is the first test to fail,
  707. * print a header to the data file.
  708. *
  709. IF( NERRS.EQ.0 ) THEN
  710. WRITE( NOUT, FMT = 9995 )'DGX'
  711. *
  712. * Matrix types
  713. *
  714. WRITE( NOUT, FMT = 9993 )
  715. *
  716. * Tests performed
  717. *
  718. WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
  719. $ 'transpose', ( '''', I = 1, 4 )
  720. *
  721. END IF
  722. NERRS = NERRS + 1
  723. IF( RESULT( J ).LT.10000.0D0 ) THEN
  724. WRITE( NOUT, FMT = 9991 )MPLUSN, PRTYPE,
  725. $ WEIGHT, M, J, RESULT( J )
  726. ELSE
  727. WRITE( NOUT, FMT = 9990 )MPLUSN, PRTYPE,
  728. $ WEIGHT, M, J, RESULT( J )
  729. END IF
  730. END IF
  731. 20 CONTINUE
  732. *
  733. 30 CONTINUE
  734. 40 CONTINUE
  735. 50 CONTINUE
  736. 60 CONTINUE
  737. *
  738. GO TO 150
  739. *
  740. 70 CONTINUE
  741. *
  742. * Read in data from file to check accuracy of condition estimation
  743. * Read input data until N=0
  744. *
  745. NPTKNT = 0
  746. *
  747. 80 CONTINUE
  748. READ( NIN, FMT = *, END = 140 )MPLUSN
  749. IF( MPLUSN.EQ.0 )
  750. $ GO TO 140
  751. READ( NIN, FMT = *, END = 140 )N
  752. DO 90 I = 1, MPLUSN
  753. READ( NIN, FMT = * )( AI( I, J ), J = 1, MPLUSN )
  754. 90 CONTINUE
  755. DO 100 I = 1, MPLUSN
  756. READ( NIN, FMT = * )( BI( I, J ), J = 1, MPLUSN )
  757. 100 CONTINUE
  758. READ( NIN, FMT = * )PLTRU, DIFTRU
  759. *
  760. NPTKNT = NPTKNT + 1
  761. FS = .TRUE.
  762. K = 0
  763. M = MPLUSN - N
  764. *
  765. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
  766. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
  767. *
  768. * Compute the Schur factorization while swapping the
  769. * m-by-m (1,1)-blocks with n-by-n (2,2)-blocks.
  770. *
  771. CALL DGGESX( 'V', 'V', 'S', DLCTSX, 'B', MPLUSN, AI, LDA, BI, LDA,
  772. $ MM, ALPHAR, ALPHAI, BETA, Q, LDA, Z, LDA, PL, DIFEST,
  773. $ WORK, LWORK, IWORK, LIWORK, BWORK, LINFO )
  774. *
  775. IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
  776. RESULT( 1 ) = ULPINV
  777. WRITE( NOUT, FMT = 9998 )'DGGESX', LINFO, MPLUSN, NPTKNT
  778. GO TO 130
  779. END IF
  780. *
  781. * Compute the norm(A, B)
  782. * (should this be norm of (A,B) or (AI,BI)?)
  783. *
  784. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK, MPLUSN )
  785. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
  786. $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
  787. ABNRM = DLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN, WORK )
  788. *
  789. * Do tests (1) to (4)
  790. *
  791. CALL DGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z, LDA, WORK,
  792. $ RESULT( 1 ) )
  793. CALL DGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z, LDA, WORK,
  794. $ RESULT( 2 ) )
  795. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q, LDA, WORK,
  796. $ RESULT( 3 ) )
  797. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z, LDA, WORK,
  798. $ RESULT( 4 ) )
  799. *
  800. * Do tests (5) and (6): check Schur form of A and compare
  801. * eigenvalues with diagonals.
  802. *
  803. NTEST = 6
  804. TEMP1 = ZERO
  805. RESULT( 5 ) = ZERO
  806. RESULT( 6 ) = ZERO
  807. *
  808. DO 110 J = 1, MPLUSN
  809. ILABAD = .FALSE.
  810. IF( ALPHAI( J ).EQ.ZERO ) THEN
  811. TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
  812. $ MAX( SMLNUM, ABS( ALPHAR( J ) ), ABS( AI( J,
  813. $ J ) ) )+ABS( BETA( J )-BI( J, J ) ) /
  814. $ MAX( SMLNUM, ABS( BETA( J ) ), ABS( BI( J, J ) ) ) )
  815. $ / ULP
  816. IF( J.LT.MPLUSN ) THEN
  817. IF( AI( J+1, J ).NE.ZERO ) THEN
  818. ILABAD = .TRUE.
  819. RESULT( 5 ) = ULPINV
  820. END IF
  821. END IF
  822. IF( J.GT.1 ) THEN
  823. IF( AI( J, J-1 ).NE.ZERO ) THEN
  824. ILABAD = .TRUE.
  825. RESULT( 5 ) = ULPINV
  826. END IF
  827. END IF
  828. ELSE
  829. IF( ALPHAI( J ).GT.ZERO ) THEN
  830. I1 = J
  831. ELSE
  832. I1 = J - 1
  833. END IF
  834. IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
  835. ILABAD = .TRUE.
  836. ELSE IF( I1.LT.MPLUSN-1 ) THEN
  837. IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
  838. ILABAD = .TRUE.
  839. RESULT( 5 ) = ULPINV
  840. END IF
  841. ELSE IF( I1.GT.1 ) THEN
  842. IF( AI( I1, I1-1 ).NE.ZERO ) THEN
  843. ILABAD = .TRUE.
  844. RESULT( 5 ) = ULPINV
  845. END IF
  846. END IF
  847. IF( .NOT.ILABAD ) THEN
  848. CALL DGET53( AI( I1, I1 ), LDA, BI( I1, I1 ), LDA,
  849. $ BETA( J ), ALPHAR( J ), ALPHAI( J ), TEMP2,
  850. $ IINFO )
  851. IF( IINFO.GE.3 ) THEN
  852. WRITE( NOUT, FMT = 9997 )IINFO, J, MPLUSN, NPTKNT
  853. INFO = ABS( IINFO )
  854. END IF
  855. ELSE
  856. TEMP2 = ULPINV
  857. END IF
  858. END IF
  859. TEMP1 = MAX( TEMP1, TEMP2 )
  860. IF( ILABAD ) THEN
  861. WRITE( NOUT, FMT = 9996 )J, MPLUSN, NPTKNT
  862. END IF
  863. 110 CONTINUE
  864. RESULT( 6 ) = TEMP1
  865. *
  866. * Test (7) (if sorting worked) <--------- need to be checked.
  867. *
  868. NTEST = 7
  869. RESULT( 7 ) = ZERO
  870. IF( LINFO.EQ.MPLUSN+3 )
  871. $ RESULT( 7 ) = ULPINV
  872. *
  873. * Test (8): compare the estimated value of DIF and its true value.
  874. *
  875. NTEST = 8
  876. RESULT( 8 ) = ZERO
  877. IF( DIFEST( 2 ).EQ.ZERO ) THEN
  878. IF( DIFTRU.GT.ABNRM*ULP )
  879. $ RESULT( 8 ) = ULPINV
  880. ELSE IF( DIFTRU.EQ.ZERO ) THEN
  881. IF( DIFEST( 2 ).GT.ABNRM*ULP )
  882. $ RESULT( 8 ) = ULPINV
  883. ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
  884. $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
  885. RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ), DIFEST( 2 ) / DIFTRU )
  886. END IF
  887. *
  888. * Test (9)
  889. *
  890. NTEST = 9
  891. RESULT( 9 ) = ZERO
  892. IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
  893. IF( DIFTRU.GT.ABNRM*ULP )
  894. $ RESULT( 9 ) = ULPINV
  895. IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
  896. $ RESULT( 9 ) = ULPINV
  897. IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
  898. $ RESULT( 9 ) = ULPINV
  899. END IF
  900. *
  901. * Test (10): compare the estimated value of PL and it true value.
  902. *
  903. NTEST = 10
  904. RESULT( 10 ) = ZERO
  905. IF( PL( 1 ).EQ.ZERO ) THEN
  906. IF( PLTRU.GT.ABNRM*ULP )
  907. $ RESULT( 10 ) = ULPINV
  908. ELSE IF( PLTRU.EQ.ZERO ) THEN
  909. IF( PL( 1 ).GT.ABNRM*ULP )
  910. $ RESULT( 10 ) = ULPINV
  911. ELSE IF( ( PLTRU.GT.THRESH*PL( 1 ) ) .OR.
  912. $ ( PLTRU*THRESH.LT.PL( 1 ) ) ) THEN
  913. RESULT( 10 ) = ULPINV
  914. END IF
  915. *
  916. NTESTT = NTESTT + NTEST
  917. *
  918. * Print out tests which fail.
  919. *
  920. DO 120 J = 1, NTEST
  921. IF( RESULT( J ).GE.THRESH ) THEN
  922. *
  923. * If this is the first test to fail,
  924. * print a header to the data file.
  925. *
  926. IF( NERRS.EQ.0 ) THEN
  927. WRITE( NOUT, FMT = 9995 )'DGX'
  928. *
  929. * Matrix types
  930. *
  931. WRITE( NOUT, FMT = 9994 )
  932. *
  933. * Tests performed
  934. *
  935. WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
  936. $ 'transpose', ( '''', I = 1, 4 )
  937. *
  938. END IF
  939. NERRS = NERRS + 1
  940. IF( RESULT( J ).LT.10000.0D0 ) THEN
  941. WRITE( NOUT, FMT = 9989 )NPTKNT, MPLUSN, J, RESULT( J )
  942. ELSE
  943. WRITE( NOUT, FMT = 9988 )NPTKNT, MPLUSN, J, RESULT( J )
  944. END IF
  945. END IF
  946. *
  947. 120 CONTINUE
  948. *
  949. 130 CONTINUE
  950. GO TO 80
  951. 140 CONTINUE
  952. *
  953. 150 CONTINUE
  954. *
  955. * Summary
  956. *
  957. CALL ALASVM( 'DGX', NOUT, NERRS, NTESTT, 0 )
  958. *
  959. WORK( 1 ) = MAXWRK
  960. *
  961. RETURN
  962. *
  963. 9999 FORMAT( ' DDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
  964. $ I6, ', JTYPE=', I6, ')' )
  965. *
  966. 9998 FORMAT( ' DDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
  967. $ I6, ', Input Example #', I2, ')' )
  968. *
  969. 9997 FORMAT( ' DDRGSX: DGET53 returned INFO=', I1, ' for eigenvalue ',
  970. $ I6, '.', / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
  971. *
  972. 9996 FORMAT( ' DDRGSX: S not in Schur form at eigenvalue ', I6, '.',
  973. $ / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
  974. *
  975. 9995 FORMAT( / 1X, A3, ' -- Real Expert Generalized Schur form',
  976. $ ' problem driver' )
  977. *
  978. 9994 FORMAT( 'Input Example' )
  979. *
  980. 9993 FORMAT( ' Matrix types: ', /
  981. $ ' 1: A is a block diagonal matrix of Jordan blocks ',
  982. $ 'and B is the identity ', / ' matrix, ',
  983. $ / ' 2: A and B are upper triangular matrices, ',
  984. $ / ' 3: A and B are as type 2, but each second diagonal ',
  985. $ 'block in A_11 and ', /
  986. $ ' each third diagonal block in A_22 are 2x2 blocks,',
  987. $ / ' 4: A and B are block diagonal matrices, ',
  988. $ / ' 5: (A,B) has potentially close or common ',
  989. $ 'eigenvalues.', / )
  990. *
  991. 9992 FORMAT( / ' Tests performed: (S is Schur, T is triangular, ',
  992. $ 'Q and Z are ', A, ',', / 19X,
  993. $ ' a is alpha, b is beta, and ', A, ' means ', A, '.)',
  994. $ / ' 1 = | A - Q S Z', A,
  995. $ ' | / ( |A| n ulp ) 2 = | B - Q T Z', A,
  996. $ ' | / ( |B| n ulp )', / ' 3 = | I - QQ', A,
  997. $ ' | / ( n ulp ) 4 = | I - ZZ', A,
  998. $ ' | / ( n ulp )', / ' 5 = 1/ULP if A is not in ',
  999. $ 'Schur form S', / ' 6 = difference between (alpha,beta)',
  1000. $ ' and diagonals of (S,T)', /
  1001. $ ' 7 = 1/ULP if SDIM is not the correct number of ',
  1002. $ 'selected eigenvalues', /
  1003. $ ' 8 = 1/ULP if DIFEST/DIFTRU > 10*THRESH or ',
  1004. $ 'DIFTRU/DIFEST > 10*THRESH',
  1005. $ / ' 9 = 1/ULP if DIFEST <> 0 or DIFTRU > ULP*norm(A,B) ',
  1006. $ 'when reordering fails', /
  1007. $ ' 10 = 1/ULP if PLEST/PLTRU > THRESH or ',
  1008. $ 'PLTRU/PLEST > THRESH', /
  1009. $ ' ( Test 10 is only for input examples )', / )
  1010. 9991 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', D10.3,
  1011. $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, F8.2 )
  1012. 9990 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', D10.3,
  1013. $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, D10.3 )
  1014. 9989 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
  1015. $ ' result ', I2, ' is', 0P, F8.2 )
  1016. 9988 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
  1017. $ ' result ', I2, ' is', 1P, D10.3 )
  1018. *
  1019. * End of DDRGSX
  1020. *
  1021. END