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

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