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.

sdrgsx.f 36 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023
  1. *> \brief \b SDRGSX
  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 SDRGSX( NSIZE, NCMAX, THRESH, NIN, NOUT, A, LDA, B,
  12. * AI, 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. * REAL THRESH
  19. * ..
  20. * .. Array Arguments ..
  21. * LOGICAL BWORK( * )
  22. * INTEGER IWORK( * )
  23. * REAL 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. *> SDRGSX checks the nonsymmetric generalized eigenvalue (Schur form)
  36. *> problem expert driver SGGESX.
  37. *>
  38. *> SGGESX 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 SDRGSX is called with NSIZE > 0, five (5) types of built-in
  57. *> matrix pairs are used to test the routine SGGESX.
  58. *>
  59. *> When SDRGSX is called with NSIZE = 0, it reads in test matrix data
  60. *> to test SGGESX.
  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 SGGESX, 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 SGESVD) 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 SLATM5).
  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 SGGESX.
  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 SLAKF2
  199. *> \endverbatim
  200. *>
  201. *> \param[in] THRESH
  202. *> \verbatim
  203. *> THRESH is REAL
  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 REAL 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 REAL 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 REAL array, dimension (LDA, NSIZE)
  251. *> Copy of A, modified by SGGESX.
  252. *> \endverbatim
  253. *>
  254. *> \param[out] BI
  255. *> \verbatim
  256. *> BI is REAL array, dimension (LDA, NSIZE)
  257. *> Copy of B, modified by SGGESX.
  258. *> \endverbatim
  259. *>
  260. *> \param[out] Z
  261. *> \verbatim
  262. *> Z is REAL array, dimension (LDA, NSIZE)
  263. *> Z holds the left Schur vectors computed by SGGESX.
  264. *> \endverbatim
  265. *>
  266. *> \param[out] Q
  267. *> \verbatim
  268. *> Q is REAL array, dimension (LDA, NSIZE)
  269. *> Q holds the right Schur vectors computed by SGGESX.
  270. *> \endverbatim
  271. *>
  272. *> \param[out] ALPHAR
  273. *> \verbatim
  274. *> ALPHAR is REAL array, dimension (NSIZE)
  275. *> \endverbatim
  276. *>
  277. *> \param[out] ALPHAI
  278. *> \verbatim
  279. *> ALPHAI is REAL array, dimension (NSIZE)
  280. *> \endverbatim
  281. *>
  282. *> \param[out] BETA
  283. *> \verbatim
  284. *> BETA is REAL array, dimension (NSIZE)
  285. *> \verbatim
  286. *> On exit, (ALPHAR + ALPHAI*i)/BETA are the eigenvalues.
  287. *> \endverbatim
  288. *>
  289. *> \param[out] C
  290. *> \verbatim
  291. *> C is REAL array, dimension (LDC, LDC)
  292. *> Store the matrix generated by subroutine SLAKF2, 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 REAL array, dimension (LDC)
  306. *> Singular values of C
  307. *> \endverbatim
  308. *>
  309. *> \param[out] WORK
  310. *> \verbatim
  311. *> WORK is REAL 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 single_eig
  354. *
  355. * =====================================================================
  356. SUBROUTINE SDRGSX( NSIZE, NCMAX, THRESH, NIN, NOUT, A, LDA, B,
  357. $ AI, 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. REAL THRESH
  368. * ..
  369. * .. Array Arguments ..
  370. LOGICAL BWORK( * )
  371. INTEGER IWORK( * )
  372. REAL 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. REAL ZERO, ONE, TEN
  382. PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0, TEN = 1.0E+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. REAL ABNRM, BIGNUM, DIFTRU, PLTRU, SMLNUM, TEMP1,
  391. $ TEMP2, THRSH2, ULP, ULPINV, WEIGHT
  392. * ..
  393. * .. Local Arrays ..
  394. REAL DIFEST( 2 ), PL( 2 ), RESULT( 10 )
  395. * ..
  396. * .. External Functions ..
  397. LOGICAL SLCTSX
  398. INTEGER ILAENV
  399. REAL SLAMCH, SLANGE
  400. EXTERNAL SLCTSX, ILAENV, SLAMCH, SLANGE
  401. * ..
  402. * .. External Subroutines ..
  403. EXTERNAL ALASVM, SGESVD, SGET51, SGET53, SGGESX, SLABAD,
  404. $ SLACPY, SLAKF2, SLASET, SLATM5, 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. c MINWRK = MAX( 10*( NSIZE+1 ), 5*NSIZE*NSIZE / 2-2 )
  446. MINWRK = MAX( 10*( NSIZE+1 ), 5*NSIZE*NSIZE / 2 )
  447. *
  448. * workspace for sggesx
  449. *
  450. MAXWRK = 9*( NSIZE+1 ) + NSIZE*
  451. $ ILAENV( 1, 'SGEQRF', ' ', NSIZE, 1, NSIZE, 0 )
  452. MAXWRK = MAX( MAXWRK, 9*( NSIZE+1 )+NSIZE*
  453. $ ILAENV( 1, 'SORGQR', ' ', NSIZE, 1, NSIZE, -1 ) )
  454. *
  455. * workspace for sgesvd
  456. *
  457. BDSPAC = 5*NSIZE*NSIZE / 2
  458. MAXWRK = MAX( MAXWRK, 3*NSIZE*NSIZE / 2+NSIZE*NSIZE*
  459. $ ILAENV( 1, 'SGEBRD', ' ', NSIZE*NSIZE / 2,
  460. $ NSIZE*NSIZE / 2, -1, -1 ) )
  461. MAXWRK = MAX( MAXWRK, BDSPAC )
  462. *
  463. MAXWRK = MAX( MAXWRK, MINWRK )
  464. *
  465. WORK( 1 ) = MAXWRK
  466. END IF
  467. *
  468. IF( LWORK.LT.MINWRK )
  469. $ INFO = -19
  470. *
  471. IF( INFO.NE.0 ) THEN
  472. CALL XERBLA( 'SDRGSX', -INFO )
  473. RETURN
  474. END IF
  475. *
  476. * Important constants
  477. *
  478. ULP = SLAMCH( 'P' )
  479. ULPINV = ONE / ULP
  480. SMLNUM = SLAMCH( 'S' ) / ULP
  481. BIGNUM = ONE / SMLNUM
  482. CALL SLABAD( SMLNUM, BIGNUM )
  483. THRSH2 = TEN*THRESH
  484. NTESTT = 0
  485. NERRS = 0
  486. *
  487. * Go to the tests for read-in matrix pairs
  488. *
  489. IFUNC = 0
  490. IF( NSIZE.EQ.0 )
  491. $ GO TO 70
  492. *
  493. * Test the built-in matrix pairs.
  494. * Loop over different functions (IFUNC) of SGGESX, types (PRTYPE)
  495. * of test matrices, different size (M+N)
  496. *
  497. PRTYPE = 0
  498. QBA = 3
  499. QBB = 4
  500. WEIGHT = SQRT( ULP )
  501. *
  502. DO 60 IFUNC = 0, 3
  503. DO 50 PRTYPE = 1, 5
  504. DO 40 M = 1, NSIZE - 1
  505. DO 30 N = 1, NSIZE - M
  506. *
  507. WEIGHT = ONE / WEIGHT
  508. MPLUSN = M + N
  509. *
  510. * Generate test matrices
  511. *
  512. FS = .TRUE.
  513. K = 0
  514. *
  515. CALL SLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, AI,
  516. $ LDA )
  517. CALL SLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, BI,
  518. $ LDA )
  519. *
  520. CALL SLATM5( PRTYPE, M, N, AI, LDA, AI( M+1, M+1 ),
  521. $ LDA, AI( 1, M+1 ), LDA, BI, LDA,
  522. $ BI( M+1, M+1 ), LDA, BI( 1, M+1 ), LDA,
  523. $ Q, LDA, Z, LDA, WEIGHT, QBA, QBB )
  524. *
  525. * Compute the Schur factorization and swapping the
  526. * m-by-m (1,1)-blocks with n-by-n (2,2)-blocks.
  527. * Swapping is accomplished via the function SLCTSX
  528. * which is supplied below.
  529. *
  530. IF( IFUNC.EQ.0 ) THEN
  531. SENSE = 'N'
  532. ELSE IF( IFUNC.EQ.1 ) THEN
  533. SENSE = 'E'
  534. ELSE IF( IFUNC.EQ.2 ) THEN
  535. SENSE = 'V'
  536. ELSE IF( IFUNC.EQ.3 ) THEN
  537. SENSE = 'B'
  538. END IF
  539. *
  540. CALL SLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
  541. CALL SLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
  542. *
  543. CALL SGGESX( 'V', 'V', 'S', SLCTSX, SENSE, MPLUSN, AI,
  544. $ LDA, BI, LDA, MM, ALPHAR, ALPHAI, BETA,
  545. $ Q, LDA, Z, LDA, PL, DIFEST, WORK, LWORK,
  546. $ IWORK, LIWORK, BWORK, LINFO )
  547. *
  548. IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
  549. RESULT( 1 ) = ULPINV
  550. WRITE( NOUT, FMT = 9999 )'SGGESX', LINFO, MPLUSN,
  551. $ PRTYPE
  552. INFO = LINFO
  553. GO TO 30
  554. END IF
  555. *
  556. * Compute the norm(A, B)
  557. *
  558. CALL SLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK,
  559. $ MPLUSN )
  560. CALL SLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
  561. $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
  562. ABNRM = SLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN,
  563. $ WORK )
  564. *
  565. * Do tests (1) to (4)
  566. *
  567. CALL SGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z,
  568. $ LDA, WORK, RESULT( 1 ) )
  569. CALL SGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z,
  570. $ LDA, WORK, RESULT( 2 ) )
  571. CALL SGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q,
  572. $ LDA, WORK, RESULT( 3 ) )
  573. CALL SGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z,
  574. $ LDA, WORK, RESULT( 4 ) )
  575. NTEST = 4
  576. *
  577. * Do tests (5) and (6): check Schur form of A and
  578. * compare eigenvalues with diagonals.
  579. *
  580. TEMP1 = ZERO
  581. RESULT( 5 ) = ZERO
  582. RESULT( 6 ) = ZERO
  583. *
  584. DO 10 J = 1, MPLUSN
  585. ILABAD = .FALSE.
  586. IF( ALPHAI( J ).EQ.ZERO ) THEN
  587. TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
  588. $ MAX( SMLNUM, ABS( ALPHAR( J ) ),
  589. $ ABS( AI( J, J ) ) )+
  590. $ ABS( BETA( J )-BI( J, J ) ) /
  591. $ MAX( SMLNUM, ABS( BETA( J ) ),
  592. $ ABS( BI( J, J ) ) ) ) / ULP
  593. IF( J.LT.MPLUSN ) THEN
  594. IF( AI( J+1, J ).NE.ZERO ) THEN
  595. ILABAD = .TRUE.
  596. RESULT( 5 ) = ULPINV
  597. END IF
  598. END IF
  599. IF( J.GT.1 ) THEN
  600. IF( AI( J, J-1 ).NE.ZERO ) THEN
  601. ILABAD = .TRUE.
  602. RESULT( 5 ) = ULPINV
  603. END IF
  604. END IF
  605. ELSE
  606. IF( ALPHAI( J ).GT.ZERO ) THEN
  607. I1 = J
  608. ELSE
  609. I1 = J - 1
  610. END IF
  611. IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
  612. ILABAD = .TRUE.
  613. ELSE IF( I1.LT.MPLUSN-1 ) THEN
  614. IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
  615. ILABAD = .TRUE.
  616. RESULT( 5 ) = ULPINV
  617. END IF
  618. ELSE IF( I1.GT.1 ) THEN
  619. IF( AI( I1, I1-1 ).NE.ZERO ) THEN
  620. ILABAD = .TRUE.
  621. RESULT( 5 ) = ULPINV
  622. END IF
  623. END IF
  624. IF( .NOT.ILABAD ) THEN
  625. CALL SGET53( AI( I1, I1 ), LDA, BI( I1, I1 ),
  626. $ LDA, BETA( J ), ALPHAR( J ),
  627. $ ALPHAI( J ), TEMP2, IINFO )
  628. IF( IINFO.GE.3 ) THEN
  629. WRITE( NOUT, FMT = 9997 )IINFO, J,
  630. $ MPLUSN, PRTYPE
  631. INFO = ABS( IINFO )
  632. END IF
  633. ELSE
  634. TEMP2 = ULPINV
  635. END IF
  636. END IF
  637. TEMP1 = MAX( TEMP1, TEMP2 )
  638. IF( ILABAD ) THEN
  639. WRITE( NOUT, FMT = 9996 )J, MPLUSN, PRTYPE
  640. END IF
  641. 10 CONTINUE
  642. RESULT( 6 ) = TEMP1
  643. NTEST = NTEST + 2
  644. *
  645. * Test (7) (if sorting worked)
  646. *
  647. RESULT( 7 ) = ZERO
  648. IF( LINFO.EQ.MPLUSN+3 ) THEN
  649. RESULT( 7 ) = ULPINV
  650. ELSE IF( MM.NE.N ) THEN
  651. RESULT( 7 ) = ULPINV
  652. END IF
  653. NTEST = NTEST + 1
  654. *
  655. * Test (8): compare the estimated value DIF and its
  656. * value. first, compute the exact DIF.
  657. *
  658. RESULT( 8 ) = ZERO
  659. MN2 = MM*( MPLUSN-MM )*2
  660. IF( IFUNC.GE.2 .AND. MN2.LE.NCMAX*NCMAX ) THEN
  661. *
  662. * Note: for either following two causes, there are
  663. * almost same number of test cases fail the test.
  664. *
  665. CALL SLAKF2( MM, MPLUSN-MM, AI, LDA,
  666. $ AI( MM+1, MM+1 ), BI,
  667. $ BI( MM+1, MM+1 ), C, LDC )
  668. *
  669. CALL SGESVD( 'N', 'N', MN2, MN2, C, LDC, S, WORK,
  670. $ 1, WORK( 2 ), 1, WORK( 3 ), LWORK-2,
  671. $ INFO )
  672. DIFTRU = S( MN2 )
  673. *
  674. IF( DIFEST( 2 ).EQ.ZERO ) THEN
  675. IF( DIFTRU.GT.ABNRM*ULP )
  676. $ RESULT( 8 ) = ULPINV
  677. ELSE IF( DIFTRU.EQ.ZERO ) THEN
  678. IF( DIFEST( 2 ).GT.ABNRM*ULP )
  679. $ RESULT( 8 ) = ULPINV
  680. ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
  681. $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
  682. RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ),
  683. $ DIFEST( 2 ) / DIFTRU )
  684. END IF
  685. NTEST = NTEST + 1
  686. END IF
  687. *
  688. * Test (9)
  689. *
  690. RESULT( 9 ) = ZERO
  691. IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
  692. IF( DIFTRU.GT.ABNRM*ULP )
  693. $ RESULT( 9 ) = ULPINV
  694. IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
  695. $ RESULT( 9 ) = ULPINV
  696. IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
  697. $ RESULT( 9 ) = ULPINV
  698. NTEST = NTEST + 1
  699. END IF
  700. *
  701. NTESTT = NTESTT + NTEST
  702. *
  703. * Print out tests which fail.
  704. *
  705. DO 20 J = 1, 9
  706. IF( RESULT( J ).GE.THRESH ) THEN
  707. *
  708. * If this is the first test to fail,
  709. * print a header to the data file.
  710. *
  711. IF( NERRS.EQ.0 ) THEN
  712. WRITE( NOUT, FMT = 9995 )'SGX'
  713. *
  714. * Matrix types
  715. *
  716. WRITE( NOUT, FMT = 9993 )
  717. *
  718. * Tests performed
  719. *
  720. WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
  721. $ 'transpose', ( '''', I = 1, 4 )
  722. *
  723. END IF
  724. NERRS = NERRS + 1
  725. IF( RESULT( J ).LT.10000.0 ) THEN
  726. WRITE( NOUT, FMT = 9991 )MPLUSN, PRTYPE,
  727. $ WEIGHT, M, J, RESULT( J )
  728. ELSE
  729. WRITE( NOUT, FMT = 9990 )MPLUSN, PRTYPE,
  730. $ WEIGHT, M, J, RESULT( J )
  731. END IF
  732. END IF
  733. 20 CONTINUE
  734. *
  735. 30 CONTINUE
  736. 40 CONTINUE
  737. 50 CONTINUE
  738. 60 CONTINUE
  739. *
  740. GO TO 150
  741. *
  742. 70 CONTINUE
  743. *
  744. * Read in data from file to check accuracy of condition estimation
  745. * Read input data until N=0
  746. *
  747. NPTKNT = 0
  748. *
  749. 80 CONTINUE
  750. READ( NIN, FMT = *, END = 140 )MPLUSN
  751. IF( MPLUSN.EQ.0 )
  752. $ GO TO 140
  753. READ( NIN, FMT = *, END = 140 )N
  754. DO 90 I = 1, MPLUSN
  755. READ( NIN, FMT = * )( AI( I, J ), J = 1, MPLUSN )
  756. 90 CONTINUE
  757. DO 100 I = 1, MPLUSN
  758. READ( NIN, FMT = * )( BI( I, J ), J = 1, MPLUSN )
  759. 100 CONTINUE
  760. READ( NIN, FMT = * )PLTRU, DIFTRU
  761. *
  762. NPTKNT = NPTKNT + 1
  763. FS = .TRUE.
  764. K = 0
  765. M = MPLUSN - N
  766. *
  767. CALL SLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
  768. CALL SLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
  769. *
  770. * Compute the Schur factorization while swapping the
  771. * m-by-m (1,1)-blocks with n-by-n (2,2)-blocks.
  772. *
  773. CALL SGGESX( 'V', 'V', 'S', SLCTSX, 'B', MPLUSN, AI, LDA, BI, LDA,
  774. $ MM, ALPHAR, ALPHAI, BETA, Q, LDA, Z, LDA, PL, DIFEST,
  775. $ WORK, LWORK, IWORK, LIWORK, BWORK, LINFO )
  776. *
  777. IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
  778. RESULT( 1 ) = ULPINV
  779. WRITE( NOUT, FMT = 9998 )'SGGESX', LINFO, MPLUSN, NPTKNT
  780. GO TO 130
  781. END IF
  782. *
  783. * Compute the norm(A, B)
  784. * (should this be norm of (A,B) or (AI,BI)?)
  785. *
  786. CALL SLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK, MPLUSN )
  787. CALL SLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
  788. $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
  789. ABNRM = SLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN, WORK )
  790. *
  791. * Do tests (1) to (4)
  792. *
  793. CALL SGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z, LDA, WORK,
  794. $ RESULT( 1 ) )
  795. CALL SGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z, LDA, WORK,
  796. $ RESULT( 2 ) )
  797. CALL SGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q, LDA, WORK,
  798. $ RESULT( 3 ) )
  799. CALL SGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z, LDA, WORK,
  800. $ RESULT( 4 ) )
  801. *
  802. * Do tests (5) and (6): check Schur form of A and compare
  803. * eigenvalues with diagonals.
  804. *
  805. NTEST = 6
  806. TEMP1 = ZERO
  807. RESULT( 5 ) = ZERO
  808. RESULT( 6 ) = ZERO
  809. *
  810. DO 110 J = 1, MPLUSN
  811. ILABAD = .FALSE.
  812. IF( ALPHAI( J ).EQ.ZERO ) THEN
  813. TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
  814. $ MAX( SMLNUM, ABS( ALPHAR( J ) ), ABS( AI( J,
  815. $ J ) ) )+ABS( BETA( J )-BI( J, J ) ) /
  816. $ MAX( SMLNUM, ABS( BETA( J ) ), ABS( BI( J, J ) ) ) )
  817. $ / ULP
  818. IF( J.LT.MPLUSN ) THEN
  819. IF( AI( J+1, J ).NE.ZERO ) THEN
  820. ILABAD = .TRUE.
  821. RESULT( 5 ) = ULPINV
  822. END IF
  823. END IF
  824. IF( J.GT.1 ) THEN
  825. IF( AI( J, J-1 ).NE.ZERO ) THEN
  826. ILABAD = .TRUE.
  827. RESULT( 5 ) = ULPINV
  828. END IF
  829. END IF
  830. ELSE
  831. IF( ALPHAI( J ).GT.ZERO ) THEN
  832. I1 = J
  833. ELSE
  834. I1 = J - 1
  835. END IF
  836. IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
  837. ILABAD = .TRUE.
  838. ELSE IF( I1.LT.MPLUSN-1 ) THEN
  839. IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
  840. ILABAD = .TRUE.
  841. RESULT( 5 ) = ULPINV
  842. END IF
  843. ELSE IF( I1.GT.1 ) THEN
  844. IF( AI( I1, I1-1 ).NE.ZERO ) THEN
  845. ILABAD = .TRUE.
  846. RESULT( 5 ) = ULPINV
  847. END IF
  848. END IF
  849. IF( .NOT.ILABAD ) THEN
  850. CALL SGET53( AI( I1, I1 ), LDA, BI( I1, I1 ), LDA,
  851. $ BETA( J ), ALPHAR( J ), ALPHAI( J ), TEMP2,
  852. $ IINFO )
  853. IF( IINFO.GE.3 ) THEN
  854. WRITE( NOUT, FMT = 9997 )IINFO, J, MPLUSN, NPTKNT
  855. INFO = ABS( IINFO )
  856. END IF
  857. ELSE
  858. TEMP2 = ULPINV
  859. END IF
  860. END IF
  861. TEMP1 = MAX( TEMP1, TEMP2 )
  862. IF( ILABAD ) THEN
  863. WRITE( NOUT, FMT = 9996 )J, MPLUSN, NPTKNT
  864. END IF
  865. 110 CONTINUE
  866. RESULT( 6 ) = TEMP1
  867. *
  868. * Test (7) (if sorting worked) <--------- need to be checked.
  869. *
  870. NTEST = 7
  871. RESULT( 7 ) = ZERO
  872. IF( LINFO.EQ.MPLUSN+3 )
  873. $ RESULT( 7 ) = ULPINV
  874. *
  875. * Test (8): compare the estimated value of DIF and its true value.
  876. *
  877. NTEST = 8
  878. RESULT( 8 ) = ZERO
  879. IF( DIFEST( 2 ).EQ.ZERO ) THEN
  880. IF( DIFTRU.GT.ABNRM*ULP )
  881. $ RESULT( 8 ) = ULPINV
  882. ELSE IF( DIFTRU.EQ.ZERO ) THEN
  883. IF( DIFEST( 2 ).GT.ABNRM*ULP )
  884. $ RESULT( 8 ) = ULPINV
  885. ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
  886. $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
  887. RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ), DIFEST( 2 ) / DIFTRU )
  888. END IF
  889. *
  890. * Test (9)
  891. *
  892. NTEST = 9
  893. RESULT( 9 ) = ZERO
  894. IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
  895. IF( DIFTRU.GT.ABNRM*ULP )
  896. $ RESULT( 9 ) = ULPINV
  897. IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
  898. $ RESULT( 9 ) = ULPINV
  899. IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
  900. $ RESULT( 9 ) = ULPINV
  901. END IF
  902. *
  903. * Test (10): compare the estimated value of PL and it true value.
  904. *
  905. NTEST = 10
  906. RESULT( 10 ) = ZERO
  907. IF( PL( 1 ).EQ.ZERO ) THEN
  908. IF( PLTRU.GT.ABNRM*ULP )
  909. $ RESULT( 10 ) = ULPINV
  910. ELSE IF( PLTRU.EQ.ZERO ) THEN
  911. IF( PL( 1 ).GT.ABNRM*ULP )
  912. $ RESULT( 10 ) = ULPINV
  913. ELSE IF( ( PLTRU.GT.THRESH*PL( 1 ) ) .OR.
  914. $ ( PLTRU*THRESH.LT.PL( 1 ) ) ) THEN
  915. RESULT( 10 ) = ULPINV
  916. END IF
  917. *
  918. NTESTT = NTESTT + NTEST
  919. *
  920. * Print out tests which fail.
  921. *
  922. DO 120 J = 1, NTEST
  923. IF( RESULT( J ).GE.THRESH ) THEN
  924. *
  925. * If this is the first test to fail,
  926. * print a header to the data file.
  927. *
  928. IF( NERRS.EQ.0 ) THEN
  929. WRITE( NOUT, FMT = 9995 )'SGX'
  930. *
  931. * Matrix types
  932. *
  933. WRITE( NOUT, FMT = 9994 )
  934. *
  935. * Tests performed
  936. *
  937. WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
  938. $ 'transpose', ( '''', I = 1, 4 )
  939. *
  940. END IF
  941. NERRS = NERRS + 1
  942. IF( RESULT( J ).LT.10000.0 ) THEN
  943. WRITE( NOUT, FMT = 9989 )NPTKNT, MPLUSN, J, RESULT( J )
  944. ELSE
  945. WRITE( NOUT, FMT = 9988 )NPTKNT, MPLUSN, J, RESULT( J )
  946. END IF
  947. END IF
  948. *
  949. 120 CONTINUE
  950. *
  951. 130 CONTINUE
  952. GO TO 80
  953. 140 CONTINUE
  954. *
  955. 150 CONTINUE
  956. *
  957. * Summary
  958. *
  959. CALL ALASVM( 'SGX', NOUT, NERRS, NTESTT, 0 )
  960. *
  961. WORK( 1 ) = MAXWRK
  962. *
  963. RETURN
  964. *
  965. 9999 FORMAT( ' SDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
  966. $ I6, ', JTYPE=', I6, ')' )
  967. *
  968. 9998 FORMAT( ' SDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
  969. $ I6, ', Input Example #', I2, ')' )
  970. *
  971. 9997 FORMAT( ' SDRGSX: SGET53 returned INFO=', I1, ' for eigenvalue ',
  972. $ I6, '.', / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
  973. *
  974. 9996 FORMAT( ' SDRGSX: S not in Schur form at eigenvalue ', I6, '.',
  975. $ / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
  976. *
  977. 9995 FORMAT( / 1X, A3, ' -- Real Expert Generalized Schur form',
  978. $ ' problem driver' )
  979. *
  980. 9994 FORMAT( 'Input Example' )
  981. *
  982. 9993 FORMAT( ' Matrix types: ', /
  983. $ ' 1: A is a block diagonal matrix of Jordan blocks ',
  984. $ 'and B is the identity ', / ' matrix, ',
  985. $ / ' 2: A and B are upper triangular matrices, ',
  986. $ / ' 3: A and B are as type 2, but each second diagonal ',
  987. $ 'block in A_11 and ', /
  988. $ ' each third diaongal block in A_22 are 2x2 blocks,',
  989. $ / ' 4: A and B are block diagonal matrices, ',
  990. $ / ' 5: (A,B) has potentially close or common ',
  991. $ 'eigenvalues.', / )
  992. *
  993. 9992 FORMAT( / ' Tests performed: (S is Schur, T is triangular, ',
  994. $ 'Q and Z are ', A, ',', / 19X,
  995. $ ' a is alpha, b is beta, and ', A, ' means ', A, '.)',
  996. $ / ' 1 = | A - Q S Z', A,
  997. $ ' | / ( |A| n ulp ) 2 = | B - Q T Z', A,
  998. $ ' | / ( |B| n ulp )', / ' 3 = | I - QQ', A,
  999. $ ' | / ( n ulp ) 4 = | I - ZZ', A,
  1000. $ ' | / ( n ulp )', / ' 5 = 1/ULP if A is not in ',
  1001. $ 'Schur form S', / ' 6 = difference between (alpha,beta)',
  1002. $ ' and diagonals of (S,T)', /
  1003. $ ' 7 = 1/ULP if SDIM is not the correct number of ',
  1004. $ 'selected eigenvalues', /
  1005. $ ' 8 = 1/ULP if DIFEST/DIFTRU > 10*THRESH or ',
  1006. $ 'DIFTRU/DIFEST > 10*THRESH',
  1007. $ / ' 9 = 1/ULP if DIFEST <> 0 or DIFTRU > ULP*norm(A,B) ',
  1008. $ 'when reordering fails', /
  1009. $ ' 10 = 1/ULP if PLEST/PLTRU > THRESH or ',
  1010. $ 'PLTRU/PLEST > THRESH', /
  1011. $ ' ( Test 10 is only for input examples )', / )
  1012. 9991 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', E10.3,
  1013. $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, F8.2 )
  1014. 9990 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', E10.3,
  1015. $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, E10.3 )
  1016. 9989 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
  1017. $ ' result ', I2, ' is', 0P, F8.2 )
  1018. 9988 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
  1019. $ ' result ', I2, ' is', 1P, E10.3 )
  1020. *
  1021. * End of SDRGSX
  1022. *
  1023. END