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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025
  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. *> \date June 2016
  354. *
  355. *> \ingroup double_eig
  356. *
  357. * =====================================================================
  358. SUBROUTINE DDRGSX( NSIZE, NCMAX, THRESH, NIN, NOUT, A, LDA, B, AI,
  359. $ BI, Z, Q, ALPHAR, ALPHAI, BETA, C, LDC, S,
  360. $ WORK, LWORK, IWORK, LIWORK, BWORK, INFO )
  361. *
  362. * -- LAPACK test routine (version 3.7.0) --
  363. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  364. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  365. * June 2016
  366. *
  367. * .. Scalar Arguments ..
  368. INTEGER INFO, LDA, LDC, LIWORK, LWORK, NCMAX, NIN,
  369. $ NOUT, NSIZE
  370. DOUBLE PRECISION THRESH
  371. * ..
  372. * .. Array Arguments ..
  373. LOGICAL BWORK( * )
  374. INTEGER IWORK( * )
  375. DOUBLE PRECISION A( LDA, * ), AI( LDA, * ), ALPHAI( * ),
  376. $ ALPHAR( * ), B( LDA, * ), BETA( * ),
  377. $ BI( LDA, * ), C( LDC, * ), Q( LDA, * ), S( * ),
  378. $ WORK( * ), Z( LDA, * )
  379. * ..
  380. *
  381. * =====================================================================
  382. *
  383. * .. Parameters ..
  384. DOUBLE PRECISION ZERO, ONE, TEN
  385. PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0, TEN = 1.0D+1 )
  386. * ..
  387. * .. Local Scalars ..
  388. LOGICAL ILABAD
  389. CHARACTER SENSE
  390. INTEGER BDSPAC, I, I1, IFUNC, IINFO, J, LINFO, MAXWRK,
  391. $ MINWRK, MM, MN2, NERRS, NPTKNT, NTEST, NTESTT,
  392. $ PRTYPE, QBA, QBB
  393. DOUBLE PRECISION ABNRM, BIGNUM, DIFTRU, PLTRU, SMLNUM, TEMP1,
  394. $ TEMP2, THRSH2, ULP, ULPINV, WEIGHT
  395. * ..
  396. * .. Local Arrays ..
  397. DOUBLE PRECISION DIFEST( 2 ), PL( 2 ), RESULT( 10 )
  398. * ..
  399. * .. External Functions ..
  400. LOGICAL DLCTSX
  401. INTEGER ILAENV
  402. DOUBLE PRECISION DLAMCH, DLANGE
  403. EXTERNAL DLCTSX, ILAENV, DLAMCH, DLANGE
  404. * ..
  405. * .. External Subroutines ..
  406. EXTERNAL ALASVM, DGESVD, DGET51, DGET53, DGGESX, DLABAD,
  407. $ DLACPY, DLAKF2, DLASET, DLATM5, XERBLA
  408. * ..
  409. * .. Intrinsic Functions ..
  410. INTRINSIC ABS, MAX, SQRT
  411. * ..
  412. * .. Scalars in Common ..
  413. LOGICAL FS
  414. INTEGER K, M, MPLUSN, N
  415. * ..
  416. * .. Common blocks ..
  417. COMMON / MN / M, N, MPLUSN, K, FS
  418. * ..
  419. * .. Executable Statements ..
  420. *
  421. * Check for errors
  422. *
  423. IF( NSIZE.LT.0 ) THEN
  424. INFO = -1
  425. ELSE IF( THRESH.LT.ZERO ) THEN
  426. INFO = -2
  427. ELSE IF( NIN.LE.0 ) THEN
  428. INFO = -3
  429. ELSE IF( NOUT.LE.0 ) THEN
  430. INFO = -4
  431. ELSE IF( LDA.LT.1 .OR. LDA.LT.NSIZE ) THEN
  432. INFO = -6
  433. ELSE IF( LDC.LT.1 .OR. LDC.LT.NSIZE*NSIZE / 2 ) THEN
  434. INFO = -17
  435. ELSE IF( LIWORK.LT.NSIZE+6 ) THEN
  436. INFO = -21
  437. END IF
  438. *
  439. * Compute workspace
  440. * (Note: Comments in the code beginning "Workspace:" describe the
  441. * minimal amount of workspace needed at that point in the code,
  442. * as well as the preferred amount for good performance.
  443. * NB refers to the optimal block size for the immediately
  444. * following subroutine, as returned by ILAENV.)
  445. *
  446. MINWRK = 1
  447. IF( INFO.EQ.0 .AND. LWORK.GE.1 ) THEN
  448. MINWRK = MAX( 10*( NSIZE+1 ), 5*NSIZE*NSIZE / 2 )
  449. *
  450. * workspace for sggesx
  451. *
  452. MAXWRK = 9*( NSIZE+1 ) + NSIZE*
  453. $ ILAENV( 1, 'DGEQRF', ' ', NSIZE, 1, NSIZE, 0 )
  454. MAXWRK = MAX( MAXWRK, 9*( NSIZE+1 )+NSIZE*
  455. $ ILAENV( 1, 'DORGQR', ' ', NSIZE, 1, NSIZE, -1 ) )
  456. *
  457. * workspace for dgesvd
  458. *
  459. BDSPAC = 5*NSIZE*NSIZE / 2
  460. MAXWRK = MAX( MAXWRK, 3*NSIZE*NSIZE / 2+NSIZE*NSIZE*
  461. $ ILAENV( 1, 'DGEBRD', ' ', NSIZE*NSIZE / 2,
  462. $ NSIZE*NSIZE / 2, -1, -1 ) )
  463. MAXWRK = MAX( MAXWRK, BDSPAC )
  464. *
  465. MAXWRK = MAX( MAXWRK, MINWRK )
  466. *
  467. WORK( 1 ) = MAXWRK
  468. END IF
  469. *
  470. IF( LWORK.LT.MINWRK )
  471. $ INFO = -19
  472. *
  473. IF( INFO.NE.0 ) THEN
  474. CALL XERBLA( 'DDRGSX', -INFO )
  475. RETURN
  476. END IF
  477. *
  478. * Important constants
  479. *
  480. ULP = DLAMCH( 'P' )
  481. ULPINV = ONE / ULP
  482. SMLNUM = DLAMCH( 'S' ) / ULP
  483. BIGNUM = ONE / SMLNUM
  484. CALL DLABAD( SMLNUM, BIGNUM )
  485. THRSH2 = TEN*THRESH
  486. NTESTT = 0
  487. NERRS = 0
  488. *
  489. * Go to the tests for read-in matrix pairs
  490. *
  491. IFUNC = 0
  492. IF( NSIZE.EQ.0 )
  493. $ GO TO 70
  494. *
  495. * Test the built-in matrix pairs.
  496. * Loop over different functions (IFUNC) of DGGESX, types (PRTYPE)
  497. * of test matrices, different size (M+N)
  498. *
  499. PRTYPE = 0
  500. QBA = 3
  501. QBB = 4
  502. WEIGHT = SQRT( ULP )
  503. *
  504. DO 60 IFUNC = 0, 3
  505. DO 50 PRTYPE = 1, 5
  506. DO 40 M = 1, NSIZE - 1
  507. DO 30 N = 1, NSIZE - M
  508. *
  509. WEIGHT = ONE / WEIGHT
  510. MPLUSN = M + N
  511. *
  512. * Generate test matrices
  513. *
  514. FS = .TRUE.
  515. K = 0
  516. *
  517. CALL DLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, AI,
  518. $ LDA )
  519. CALL DLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, BI,
  520. $ LDA )
  521. *
  522. CALL DLATM5( PRTYPE, M, N, AI, LDA, AI( M+1, M+1 ),
  523. $ LDA, AI( 1, M+1 ), LDA, BI, LDA,
  524. $ BI( M+1, M+1 ), LDA, BI( 1, M+1 ), LDA,
  525. $ Q, LDA, Z, LDA, WEIGHT, QBA, QBB )
  526. *
  527. * Compute the Schur factorization and swapping the
  528. * m-by-m (1,1)-blocks with n-by-n (2,2)-blocks.
  529. * Swapping is accomplished via the function DLCTSX
  530. * which is supplied below.
  531. *
  532. IF( IFUNC.EQ.0 ) THEN
  533. SENSE = 'N'
  534. ELSE IF( IFUNC.EQ.1 ) THEN
  535. SENSE = 'E'
  536. ELSE IF( IFUNC.EQ.2 ) THEN
  537. SENSE = 'V'
  538. ELSE IF( IFUNC.EQ.3 ) THEN
  539. SENSE = 'B'
  540. END IF
  541. *
  542. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
  543. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
  544. *
  545. CALL DGGESX( 'V', 'V', 'S', DLCTSX, SENSE, MPLUSN, AI,
  546. $ LDA, BI, LDA, MM, ALPHAR, ALPHAI, BETA,
  547. $ Q, LDA, Z, LDA, PL, DIFEST, WORK, LWORK,
  548. $ IWORK, LIWORK, BWORK, LINFO )
  549. *
  550. IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
  551. RESULT( 1 ) = ULPINV
  552. WRITE( NOUT, FMT = 9999 )'DGGESX', LINFO, MPLUSN,
  553. $ PRTYPE
  554. INFO = LINFO
  555. GO TO 30
  556. END IF
  557. *
  558. * Compute the norm(A, B)
  559. *
  560. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK,
  561. $ MPLUSN )
  562. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
  563. $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
  564. ABNRM = DLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN,
  565. $ WORK )
  566. *
  567. * Do tests (1) to (4)
  568. *
  569. CALL DGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z,
  570. $ LDA, WORK, RESULT( 1 ) )
  571. CALL DGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z,
  572. $ LDA, WORK, RESULT( 2 ) )
  573. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q,
  574. $ LDA, WORK, RESULT( 3 ) )
  575. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z,
  576. $ LDA, WORK, RESULT( 4 ) )
  577. NTEST = 4
  578. *
  579. * Do tests (5) and (6): check Schur form of A and
  580. * compare eigenvalues with diagonals.
  581. *
  582. TEMP1 = ZERO
  583. RESULT( 5 ) = ZERO
  584. RESULT( 6 ) = ZERO
  585. *
  586. DO 10 J = 1, MPLUSN
  587. ILABAD = .FALSE.
  588. IF( ALPHAI( J ).EQ.ZERO ) THEN
  589. TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
  590. $ MAX( SMLNUM, ABS( ALPHAR( J ) ),
  591. $ ABS( AI( J, J ) ) )+
  592. $ ABS( BETA( J )-BI( J, J ) ) /
  593. $ MAX( SMLNUM, ABS( BETA( J ) ),
  594. $ ABS( BI( J, J ) ) ) ) / ULP
  595. IF( J.LT.MPLUSN ) THEN
  596. IF( AI( J+1, J ).NE.ZERO ) THEN
  597. ILABAD = .TRUE.
  598. RESULT( 5 ) = ULPINV
  599. END IF
  600. END IF
  601. IF( J.GT.1 ) THEN
  602. IF( AI( J, J-1 ).NE.ZERO ) THEN
  603. ILABAD = .TRUE.
  604. RESULT( 5 ) = ULPINV
  605. END IF
  606. END IF
  607. ELSE
  608. IF( ALPHAI( J ).GT.ZERO ) THEN
  609. I1 = J
  610. ELSE
  611. I1 = J - 1
  612. END IF
  613. IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
  614. ILABAD = .TRUE.
  615. ELSE IF( I1.LT.MPLUSN-1 ) THEN
  616. IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
  617. ILABAD = .TRUE.
  618. RESULT( 5 ) = ULPINV
  619. END IF
  620. ELSE IF( I1.GT.1 ) THEN
  621. IF( AI( I1, I1-1 ).NE.ZERO ) THEN
  622. ILABAD = .TRUE.
  623. RESULT( 5 ) = ULPINV
  624. END IF
  625. END IF
  626. IF( .NOT.ILABAD ) THEN
  627. CALL DGET53( AI( I1, I1 ), LDA, BI( I1, I1 ),
  628. $ LDA, BETA( J ), ALPHAR( J ),
  629. $ ALPHAI( J ), TEMP2, IINFO )
  630. IF( IINFO.GE.3 ) THEN
  631. WRITE( NOUT, FMT = 9997 )IINFO, J,
  632. $ MPLUSN, PRTYPE
  633. INFO = ABS( IINFO )
  634. END IF
  635. ELSE
  636. TEMP2 = ULPINV
  637. END IF
  638. END IF
  639. TEMP1 = MAX( TEMP1, TEMP2 )
  640. IF( ILABAD ) THEN
  641. WRITE( NOUT, FMT = 9996 )J, MPLUSN, PRTYPE
  642. END IF
  643. 10 CONTINUE
  644. RESULT( 6 ) = TEMP1
  645. NTEST = NTEST + 2
  646. *
  647. * Test (7) (if sorting worked)
  648. *
  649. RESULT( 7 ) = ZERO
  650. IF( LINFO.EQ.MPLUSN+3 ) THEN
  651. RESULT( 7 ) = ULPINV
  652. ELSE IF( MM.NE.N ) THEN
  653. RESULT( 7 ) = ULPINV
  654. END IF
  655. NTEST = NTEST + 1
  656. *
  657. * Test (8): compare the estimated value DIF and its
  658. * value. first, compute the exact DIF.
  659. *
  660. RESULT( 8 ) = ZERO
  661. MN2 = MM*( MPLUSN-MM )*2
  662. IF( IFUNC.GE.2 .AND. MN2.LE.NCMAX*NCMAX ) THEN
  663. *
  664. * Note: for either following two causes, there are
  665. * almost same number of test cases fail the test.
  666. *
  667. CALL DLAKF2( MM, MPLUSN-MM, AI, LDA,
  668. $ AI( MM+1, MM+1 ), BI,
  669. $ BI( MM+1, MM+1 ), C, LDC )
  670. *
  671. CALL DGESVD( 'N', 'N', MN2, MN2, C, LDC, S, WORK,
  672. $ 1, WORK( 2 ), 1, WORK( 3 ), LWORK-2,
  673. $ INFO )
  674. DIFTRU = S( MN2 )
  675. *
  676. IF( DIFEST( 2 ).EQ.ZERO ) THEN
  677. IF( DIFTRU.GT.ABNRM*ULP )
  678. $ RESULT( 8 ) = ULPINV
  679. ELSE IF( DIFTRU.EQ.ZERO ) THEN
  680. IF( DIFEST( 2 ).GT.ABNRM*ULP )
  681. $ RESULT( 8 ) = ULPINV
  682. ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
  683. $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
  684. RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ),
  685. $ DIFEST( 2 ) / DIFTRU )
  686. END IF
  687. NTEST = NTEST + 1
  688. END IF
  689. *
  690. * Test (9)
  691. *
  692. RESULT( 9 ) = ZERO
  693. IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
  694. IF( DIFTRU.GT.ABNRM*ULP )
  695. $ RESULT( 9 ) = ULPINV
  696. IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
  697. $ RESULT( 9 ) = ULPINV
  698. IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
  699. $ RESULT( 9 ) = ULPINV
  700. NTEST = NTEST + 1
  701. END IF
  702. *
  703. NTESTT = NTESTT + NTEST
  704. *
  705. * Print out tests which fail.
  706. *
  707. DO 20 J = 1, 9
  708. IF( RESULT( J ).GE.THRESH ) THEN
  709. *
  710. * If this is the first test to fail,
  711. * print a header to the data file.
  712. *
  713. IF( NERRS.EQ.0 ) THEN
  714. WRITE( NOUT, FMT = 9995 )'DGX'
  715. *
  716. * Matrix types
  717. *
  718. WRITE( NOUT, FMT = 9993 )
  719. *
  720. * Tests performed
  721. *
  722. WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
  723. $ 'transpose', ( '''', I = 1, 4 )
  724. *
  725. END IF
  726. NERRS = NERRS + 1
  727. IF( RESULT( J ).LT.10000.0D0 ) THEN
  728. WRITE( NOUT, FMT = 9991 )MPLUSN, PRTYPE,
  729. $ WEIGHT, M, J, RESULT( J )
  730. ELSE
  731. WRITE( NOUT, FMT = 9990 )MPLUSN, PRTYPE,
  732. $ WEIGHT, M, J, RESULT( J )
  733. END IF
  734. END IF
  735. 20 CONTINUE
  736. *
  737. 30 CONTINUE
  738. 40 CONTINUE
  739. 50 CONTINUE
  740. 60 CONTINUE
  741. *
  742. GO TO 150
  743. *
  744. 70 CONTINUE
  745. *
  746. * Read in data from file to check accuracy of condition estimation
  747. * Read input data until N=0
  748. *
  749. NPTKNT = 0
  750. *
  751. 80 CONTINUE
  752. READ( NIN, FMT = *, END = 140 )MPLUSN
  753. IF( MPLUSN.EQ.0 )
  754. $ GO TO 140
  755. READ( NIN, FMT = *, END = 140 )N
  756. DO 90 I = 1, MPLUSN
  757. READ( NIN, FMT = * )( AI( I, J ), J = 1, MPLUSN )
  758. 90 CONTINUE
  759. DO 100 I = 1, MPLUSN
  760. READ( NIN, FMT = * )( BI( I, J ), J = 1, MPLUSN )
  761. 100 CONTINUE
  762. READ( NIN, FMT = * )PLTRU, DIFTRU
  763. *
  764. NPTKNT = NPTKNT + 1
  765. FS = .TRUE.
  766. K = 0
  767. M = MPLUSN - N
  768. *
  769. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
  770. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
  771. *
  772. * Compute the Schur factorization while swapping the
  773. * m-by-m (1,1)-blocks with n-by-n (2,2)-blocks.
  774. *
  775. CALL DGGESX( 'V', 'V', 'S', DLCTSX, 'B', MPLUSN, AI, LDA, BI, LDA,
  776. $ MM, ALPHAR, ALPHAI, BETA, Q, LDA, Z, LDA, PL, DIFEST,
  777. $ WORK, LWORK, IWORK, LIWORK, BWORK, LINFO )
  778. *
  779. IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
  780. RESULT( 1 ) = ULPINV
  781. WRITE( NOUT, FMT = 9998 )'DGGESX', LINFO, MPLUSN, NPTKNT
  782. GO TO 130
  783. END IF
  784. *
  785. * Compute the norm(A, B)
  786. * (should this be norm of (A,B) or (AI,BI)?)
  787. *
  788. CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK, MPLUSN )
  789. CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
  790. $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
  791. ABNRM = DLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN, WORK )
  792. *
  793. * Do tests (1) to (4)
  794. *
  795. CALL DGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z, LDA, WORK,
  796. $ RESULT( 1 ) )
  797. CALL DGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z, LDA, WORK,
  798. $ RESULT( 2 ) )
  799. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q, LDA, WORK,
  800. $ RESULT( 3 ) )
  801. CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z, LDA, WORK,
  802. $ RESULT( 4 ) )
  803. *
  804. * Do tests (5) and (6): check Schur form of A and compare
  805. * eigenvalues with diagonals.
  806. *
  807. NTEST = 6
  808. TEMP1 = ZERO
  809. RESULT( 5 ) = ZERO
  810. RESULT( 6 ) = ZERO
  811. *
  812. DO 110 J = 1, MPLUSN
  813. ILABAD = .FALSE.
  814. IF( ALPHAI( J ).EQ.ZERO ) THEN
  815. TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
  816. $ MAX( SMLNUM, ABS( ALPHAR( J ) ), ABS( AI( J,
  817. $ J ) ) )+ABS( BETA( J )-BI( J, J ) ) /
  818. $ MAX( SMLNUM, ABS( BETA( J ) ), ABS( BI( J, J ) ) ) )
  819. $ / ULP
  820. IF( J.LT.MPLUSN ) THEN
  821. IF( AI( J+1, J ).NE.ZERO ) THEN
  822. ILABAD = .TRUE.
  823. RESULT( 5 ) = ULPINV
  824. END IF
  825. END IF
  826. IF( J.GT.1 ) THEN
  827. IF( AI( J, J-1 ).NE.ZERO ) THEN
  828. ILABAD = .TRUE.
  829. RESULT( 5 ) = ULPINV
  830. END IF
  831. END IF
  832. ELSE
  833. IF( ALPHAI( J ).GT.ZERO ) THEN
  834. I1 = J
  835. ELSE
  836. I1 = J - 1
  837. END IF
  838. IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
  839. ILABAD = .TRUE.
  840. ELSE IF( I1.LT.MPLUSN-1 ) THEN
  841. IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
  842. ILABAD = .TRUE.
  843. RESULT( 5 ) = ULPINV
  844. END IF
  845. ELSE IF( I1.GT.1 ) THEN
  846. IF( AI( I1, I1-1 ).NE.ZERO ) THEN
  847. ILABAD = .TRUE.
  848. RESULT( 5 ) = ULPINV
  849. END IF
  850. END IF
  851. IF( .NOT.ILABAD ) THEN
  852. CALL DGET53( AI( I1, I1 ), LDA, BI( I1, I1 ), LDA,
  853. $ BETA( J ), ALPHAR( J ), ALPHAI( J ), TEMP2,
  854. $ IINFO )
  855. IF( IINFO.GE.3 ) THEN
  856. WRITE( NOUT, FMT = 9997 )IINFO, J, MPLUSN, NPTKNT
  857. INFO = ABS( IINFO )
  858. END IF
  859. ELSE
  860. TEMP2 = ULPINV
  861. END IF
  862. END IF
  863. TEMP1 = MAX( TEMP1, TEMP2 )
  864. IF( ILABAD ) THEN
  865. WRITE( NOUT, FMT = 9996 )J, MPLUSN, NPTKNT
  866. END IF
  867. 110 CONTINUE
  868. RESULT( 6 ) = TEMP1
  869. *
  870. * Test (7) (if sorting worked) <--------- need to be checked.
  871. *
  872. NTEST = 7
  873. RESULT( 7 ) = ZERO
  874. IF( LINFO.EQ.MPLUSN+3 )
  875. $ RESULT( 7 ) = ULPINV
  876. *
  877. * Test (8): compare the estimated value of DIF and its true value.
  878. *
  879. NTEST = 8
  880. RESULT( 8 ) = ZERO
  881. IF( DIFEST( 2 ).EQ.ZERO ) THEN
  882. IF( DIFTRU.GT.ABNRM*ULP )
  883. $ RESULT( 8 ) = ULPINV
  884. ELSE IF( DIFTRU.EQ.ZERO ) THEN
  885. IF( DIFEST( 2 ).GT.ABNRM*ULP )
  886. $ RESULT( 8 ) = ULPINV
  887. ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
  888. $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
  889. RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ), DIFEST( 2 ) / DIFTRU )
  890. END IF
  891. *
  892. * Test (9)
  893. *
  894. NTEST = 9
  895. RESULT( 9 ) = ZERO
  896. IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
  897. IF( DIFTRU.GT.ABNRM*ULP )
  898. $ RESULT( 9 ) = ULPINV
  899. IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
  900. $ RESULT( 9 ) = ULPINV
  901. IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
  902. $ RESULT( 9 ) = ULPINV
  903. END IF
  904. *
  905. * Test (10): compare the estimated value of PL and it true value.
  906. *
  907. NTEST = 10
  908. RESULT( 10 ) = ZERO
  909. IF( PL( 1 ).EQ.ZERO ) THEN
  910. IF( PLTRU.GT.ABNRM*ULP )
  911. $ RESULT( 10 ) = ULPINV
  912. ELSE IF( PLTRU.EQ.ZERO ) THEN
  913. IF( PL( 1 ).GT.ABNRM*ULP )
  914. $ RESULT( 10 ) = ULPINV
  915. ELSE IF( ( PLTRU.GT.THRESH*PL( 1 ) ) .OR.
  916. $ ( PLTRU*THRESH.LT.PL( 1 ) ) ) THEN
  917. RESULT( 10 ) = ULPINV
  918. END IF
  919. *
  920. NTESTT = NTESTT + NTEST
  921. *
  922. * Print out tests which fail.
  923. *
  924. DO 120 J = 1, NTEST
  925. IF( RESULT( J ).GE.THRESH ) THEN
  926. *
  927. * If this is the first test to fail,
  928. * print a header to the data file.
  929. *
  930. IF( NERRS.EQ.0 ) THEN
  931. WRITE( NOUT, FMT = 9995 )'DGX'
  932. *
  933. * Matrix types
  934. *
  935. WRITE( NOUT, FMT = 9994 )
  936. *
  937. * Tests performed
  938. *
  939. WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
  940. $ 'transpose', ( '''', I = 1, 4 )
  941. *
  942. END IF
  943. NERRS = NERRS + 1
  944. IF( RESULT( J ).LT.10000.0D0 ) THEN
  945. WRITE( NOUT, FMT = 9989 )NPTKNT, MPLUSN, J, RESULT( J )
  946. ELSE
  947. WRITE( NOUT, FMT = 9988 )NPTKNT, MPLUSN, J, RESULT( J )
  948. END IF
  949. END IF
  950. *
  951. 120 CONTINUE
  952. *
  953. 130 CONTINUE
  954. GO TO 80
  955. 140 CONTINUE
  956. *
  957. 150 CONTINUE
  958. *
  959. * Summary
  960. *
  961. CALL ALASVM( 'DGX', NOUT, NERRS, NTESTT, 0 )
  962. *
  963. WORK( 1 ) = MAXWRK
  964. *
  965. RETURN
  966. *
  967. 9999 FORMAT( ' DDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
  968. $ I6, ', JTYPE=', I6, ')' )
  969. *
  970. 9998 FORMAT( ' DDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
  971. $ I6, ', Input Example #', I2, ')' )
  972. *
  973. 9997 FORMAT( ' DDRGSX: DGET53 returned INFO=', I1, ' for eigenvalue ',
  974. $ I6, '.', / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
  975. *
  976. 9996 FORMAT( ' DDRGSX: S not in Schur form at eigenvalue ', I6, '.',
  977. $ / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
  978. *
  979. 9995 FORMAT( / 1X, A3, ' -- Real Expert Generalized Schur form',
  980. $ ' problem driver' )
  981. *
  982. 9994 FORMAT( 'Input Example' )
  983. *
  984. 9993 FORMAT( ' Matrix types: ', /
  985. $ ' 1: A is a block diagonal matrix of Jordan blocks ',
  986. $ 'and B is the identity ', / ' matrix, ',
  987. $ / ' 2: A and B are upper triangular matrices, ',
  988. $ / ' 3: A and B are as type 2, but each second diagonal ',
  989. $ 'block in A_11 and ', /
  990. $ ' each third diaongal block in A_22 are 2x2 blocks,',
  991. $ / ' 4: A and B are block diagonal matrices, ',
  992. $ / ' 5: (A,B) has potentially close or common ',
  993. $ 'eigenvalues.', / )
  994. *
  995. 9992 FORMAT( / ' Tests performed: (S is Schur, T is triangular, ',
  996. $ 'Q and Z are ', A, ',', / 19X,
  997. $ ' a is alpha, b is beta, and ', A, ' means ', A, '.)',
  998. $ / ' 1 = | A - Q S Z', A,
  999. $ ' | / ( |A| n ulp ) 2 = | B - Q T Z', A,
  1000. $ ' | / ( |B| n ulp )', / ' 3 = | I - QQ', A,
  1001. $ ' | / ( n ulp ) 4 = | I - ZZ', A,
  1002. $ ' | / ( n ulp )', / ' 5 = 1/ULP if A is not in ',
  1003. $ 'Schur form S', / ' 6 = difference between (alpha,beta)',
  1004. $ ' and diagonals of (S,T)', /
  1005. $ ' 7 = 1/ULP if SDIM is not the correct number of ',
  1006. $ 'selected eigenvalues', /
  1007. $ ' 8 = 1/ULP if DIFEST/DIFTRU > 10*THRESH or ',
  1008. $ 'DIFTRU/DIFEST > 10*THRESH',
  1009. $ / ' 9 = 1/ULP if DIFEST <> 0 or DIFTRU > ULP*norm(A,B) ',
  1010. $ 'when reordering fails', /
  1011. $ ' 10 = 1/ULP if PLEST/PLTRU > THRESH or ',
  1012. $ 'PLTRU/PLEST > THRESH', /
  1013. $ ' ( Test 10 is only for input examples )', / )
  1014. 9991 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', D10.3,
  1015. $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, F8.2 )
  1016. 9990 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', D10.3,
  1017. $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, D10.3 )
  1018. 9989 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
  1019. $ ' result ', I2, ' is', 0P, F8.2 )
  1020. 9988 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
  1021. $ ' result ', I2, ' is', 1P, D10.3 )
  1022. *
  1023. * End of DDRGSX
  1024. *
  1025. END