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.

ddrges.f 37 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  1. *> \brief \b DDRGES
  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 DDRGES( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
  12. * NOUNIT, A, LDA, B, S, T, Q, LDQ, Z, ALPHAR,
  13. * ALPHAI, BETA, WORK, LWORK, RESULT, BWORK,
  14. * INFO )
  15. *
  16. * .. Scalar Arguments ..
  17. * INTEGER INFO, LDA, LDQ, LWORK, NOUNIT, NSIZES, NTYPES
  18. * DOUBLE PRECISION THRESH
  19. * ..
  20. * .. Array Arguments ..
  21. * LOGICAL BWORK( * ), DOTYPE( * )
  22. * INTEGER ISEED( 4 ), NN( * )
  23. * DOUBLE PRECISION A( LDA, * ), ALPHAI( * ), ALPHAR( * ),
  24. * $ B( LDA, * ), BETA( * ), Q( LDQ, * ),
  25. * $ RESULT( 13 ), S( LDA, * ), T( LDA, * ),
  26. * $ WORK( * ), Z( LDQ, * )
  27. * ..
  28. *
  29. *
  30. *> \par Purpose:
  31. * =============
  32. *>
  33. *> \verbatim
  34. *>
  35. *> DDRGES checks the nonsymmetric generalized eigenvalue (Schur form)
  36. *> problem driver DGGES.
  37. *>
  38. *> DGGES 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(j),beta(j)), j=1,...,n,
  44. *> Thus, w(j) = alpha(j)/beta(j) is a root of the characteristic
  45. *> equation
  46. *> det( A - w(j) B ) = 0
  47. *> Optionally it also reorder the eigenvalues so that a selected
  48. *> cluster of eigenvalues appears in the leading diagonal block of the
  49. *> Schur forms.
  50. *>
  51. *> When DDRGES is called, a number of matrix "sizes" ("N's") and a
  52. *> number of matrix "TYPES" are specified. For each size ("N")
  53. *> and each TYPE of matrix, a pair of matrices (A, B) will be generated
  54. *> and used for testing. For each matrix pair, the following 13 tests
  55. *> will be performed and compared with the threshold THRESH except
  56. *> the tests (5), (11) and (13).
  57. *>
  58. *>
  59. *> (1) | A - Q S Z' | / ( |A| n ulp ) (no sorting of eigenvalues)
  60. *>
  61. *>
  62. *> (2) | B - Q T Z' | / ( |B| n ulp ) (no sorting of eigenvalues)
  63. *>
  64. *>
  65. *> (3) | I - QQ' | / ( n ulp ) (no sorting of eigenvalues)
  66. *>
  67. *>
  68. *> (4) | I - ZZ' | / ( n ulp ) (no sorting of eigenvalues)
  69. *>
  70. *> (5) if A is in Schur form (i.e. quasi-triangular form)
  71. *> (no sorting of eigenvalues)
  72. *>
  73. *> (6) if eigenvalues = diagonal blocks of the Schur form (S, T),
  74. *> i.e., test the maximum over j of D(j) where:
  75. *>
  76. *> if alpha(j) is real:
  77. *> |alpha(j) - S(j,j)| |beta(j) - T(j,j)|
  78. *> D(j) = ------------------------ + -----------------------
  79. *> max(|alpha(j)|,|S(j,j)|) max(|beta(j)|,|T(j,j)|)
  80. *>
  81. *> if alpha(j) is complex:
  82. *> | det( s S - w T ) |
  83. *> D(j) = ---------------------------------------------------
  84. *> ulp max( s norm(S), |w| norm(T) )*norm( s S - w T )
  85. *>
  86. *> and S and T are here the 2 x 2 diagonal blocks of S and T
  87. *> corresponding to the j-th and j+1-th eigenvalues.
  88. *> (no sorting of eigenvalues)
  89. *>
  90. *> (7) | (A,B) - Q (S,T) Z' | / ( | (A,B) | n ulp )
  91. *> (with sorting of eigenvalues).
  92. *>
  93. *> (8) | I - QQ' | / ( n ulp ) (with sorting of eigenvalues).
  94. *>
  95. *> (9) | I - ZZ' | / ( n ulp ) (with sorting of eigenvalues).
  96. *>
  97. *> (10) if A is in Schur form (i.e. quasi-triangular form)
  98. *> (with sorting of eigenvalues).
  99. *>
  100. *> (11) if eigenvalues = diagonal blocks of the Schur form (S, T),
  101. *> i.e. test the maximum over j of D(j) where:
  102. *>
  103. *> if alpha(j) is real:
  104. *> |alpha(j) - S(j,j)| |beta(j) - T(j,j)|
  105. *> D(j) = ------------------------ + -----------------------
  106. *> max(|alpha(j)|,|S(j,j)|) max(|beta(j)|,|T(j,j)|)
  107. *>
  108. *> if alpha(j) is complex:
  109. *> | det( s S - w T ) |
  110. *> D(j) = ---------------------------------------------------
  111. *> ulp max( s norm(S), |w| norm(T) )*norm( s S - w T )
  112. *>
  113. *> and S and T are here the 2 x 2 diagonal blocks of S and T
  114. *> corresponding to the j-th and j+1-th eigenvalues.
  115. *> (with sorting of eigenvalues).
  116. *>
  117. *> (12) if sorting worked and SDIM is the number of eigenvalues
  118. *> which were SELECTed.
  119. *>
  120. *> Test Matrices
  121. *> =============
  122. *>
  123. *> The sizes of the test matrices are specified by an array
  124. *> NN(1:NSIZES); the value of each element NN(j) specifies one size.
  125. *> The "types" are specified by a logical array DOTYPE( 1:NTYPES ); if
  126. *> DOTYPE(j) is .TRUE., then matrix type "j" will be generated.
  127. *> Currently, the list of possible types is:
  128. *>
  129. *> (1) ( 0, 0 ) (a pair of zero matrices)
  130. *>
  131. *> (2) ( I, 0 ) (an identity and a zero matrix)
  132. *>
  133. *> (3) ( 0, I ) (an identity and a zero matrix)
  134. *>
  135. *> (4) ( I, I ) (a pair of identity matrices)
  136. *>
  137. *> t t
  138. *> (5) ( J , J ) (a pair of transposed Jordan blocks)
  139. *>
  140. *> t ( I 0 )
  141. *> (6) ( X, Y ) where X = ( J 0 ) and Y = ( t )
  142. *> ( 0 I ) ( 0 J )
  143. *> and I is a k x k identity and J a (k+1)x(k+1)
  144. *> Jordan block; k=(N-1)/2
  145. *>
  146. *> (7) ( D, I ) where D is diag( 0, 1,..., N-1 ) (a diagonal
  147. *> matrix with those diagonal entries.)
  148. *> (8) ( I, D )
  149. *>
  150. *> (9) ( big*D, small*I ) where "big" is near overflow and small=1/big
  151. *>
  152. *> (10) ( small*D, big*I )
  153. *>
  154. *> (11) ( big*I, small*D )
  155. *>
  156. *> (12) ( small*I, big*D )
  157. *>
  158. *> (13) ( big*D, big*I )
  159. *>
  160. *> (14) ( small*D, small*I )
  161. *>
  162. *> (15) ( D1, D2 ) where D1 is diag( 0, 0, 1, ..., N-3, 0 ) and
  163. *> D2 is diag( 0, N-3, N-4,..., 1, 0, 0 )
  164. *> t t
  165. *> (16) Q ( J , J ) Z where Q and Z are random orthogonal matrices.
  166. *>
  167. *> (17) Q ( T1, T2 ) Z where T1 and T2 are upper triangular matrices
  168. *> with random O(1) entries above the diagonal
  169. *> and diagonal entries diag(T1) =
  170. *> ( 0, 0, 1, ..., N-3, 0 ) and diag(T2) =
  171. *> ( 0, N-3, N-4,..., 1, 0, 0 )
  172. *>
  173. *> (18) Q ( T1, T2 ) Z diag(T1) = ( 0, 0, 1, 1, s, ..., s, 0 )
  174. *> diag(T2) = ( 0, 1, 0, 1,..., 1, 0 )
  175. *> s = machine precision.
  176. *>
  177. *> (19) Q ( T1, T2 ) Z diag(T1)=( 0,0,1,1, 1-d, ..., 1-(N-5)*d=s, 0 )
  178. *> diag(T2) = ( 0, 1, 0, 1, ..., 1, 0 )
  179. *>
  180. *> N-5
  181. *> (20) Q ( T1, T2 ) Z diag(T1)=( 0, 0, 1, 1, a, ..., a =s, 0 )
  182. *> diag(T2) = ( 0, 1, 0, 1, ..., 1, 0, 0 )
  183. *>
  184. *> (21) Q ( T1, T2 ) Z diag(T1)=( 0, 0, 1, r1, r2, ..., r(N-4), 0 )
  185. *> diag(T2) = ( 0, 1, 0, 1, ..., 1, 0, 0 )
  186. *> where r1,..., r(N-4) are random.
  187. *>
  188. *> (22) Q ( big*T1, small*T2 ) Z diag(T1) = ( 0, 0, 1, ..., N-3, 0 )
  189. *> diag(T2) = ( 0, 1, ..., 1, 0, 0 )
  190. *>
  191. *> (23) Q ( small*T1, big*T2 ) Z diag(T1) = ( 0, 0, 1, ..., N-3, 0 )
  192. *> diag(T2) = ( 0, 1, ..., 1, 0, 0 )
  193. *>
  194. *> (24) Q ( small*T1, small*T2 ) Z diag(T1) = ( 0, 0, 1, ..., N-3, 0 )
  195. *> diag(T2) = ( 0, 1, ..., 1, 0, 0 )
  196. *>
  197. *> (25) Q ( big*T1, big*T2 ) Z diag(T1) = ( 0, 0, 1, ..., N-3, 0 )
  198. *> diag(T2) = ( 0, 1, ..., 1, 0, 0 )
  199. *>
  200. *> (26) Q ( T1, T2 ) Z where T1 and T2 are random upper-triangular
  201. *> matrices.
  202. *>
  203. *> \endverbatim
  204. *
  205. * Arguments:
  206. * ==========
  207. *
  208. *> \param[in] NSIZES
  209. *> \verbatim
  210. *> NSIZES is INTEGER
  211. *> The number of sizes of matrices to use. If it is zero,
  212. *> DDRGES does nothing. NSIZES >= 0.
  213. *> \endverbatim
  214. *>
  215. *> \param[in] NN
  216. *> \verbatim
  217. *> NN is INTEGER array, dimension (NSIZES)
  218. *> An array containing the sizes to be used for the matrices.
  219. *> Zero values will be skipped. NN >= 0.
  220. *> \endverbatim
  221. *>
  222. *> \param[in] NTYPES
  223. *> \verbatim
  224. *> NTYPES is INTEGER
  225. *> The number of elements in DOTYPE. If it is zero, DDRGES
  226. *> does nothing. It must be at least zero. If it is MAXTYP+1
  227. *> and NSIZES is 1, then an additional type, MAXTYP+1 is
  228. *> defined, which is to use whatever matrix is in A on input.
  229. *> This is only useful if DOTYPE(1:MAXTYP) is .FALSE. and
  230. *> DOTYPE(MAXTYP+1) is .TRUE. .
  231. *> \endverbatim
  232. *>
  233. *> \param[in] DOTYPE
  234. *> \verbatim
  235. *> DOTYPE is LOGICAL array, dimension (NTYPES)
  236. *> If DOTYPE(j) is .TRUE., then for each size in NN a
  237. *> matrix of that size and of type j will be generated.
  238. *> If NTYPES is smaller than the maximum number of types
  239. *> defined (PARAMETER MAXTYP), then types NTYPES+1 through
  240. *> MAXTYP will not be generated. If NTYPES is larger
  241. *> than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES)
  242. *> will be ignored.
  243. *> \endverbatim
  244. *>
  245. *> \param[in,out] ISEED
  246. *> \verbatim
  247. *> ISEED is INTEGER array, dimension (4)
  248. *> On entry ISEED specifies the seed of the random number
  249. *> generator. The array elements should be between 0 and 4095;
  250. *> if not they will be reduced mod 4096. Also, ISEED(4) must
  251. *> be odd. The random number generator uses a linear
  252. *> congruential sequence limited to small integers, and so
  253. *> should produce machine independent random numbers. The
  254. *> values of ISEED are changed on exit, and can be used in the
  255. *> next call to DDRGES to continue the same random number
  256. *> sequence.
  257. *> \endverbatim
  258. *>
  259. *> \param[in] THRESH
  260. *> \verbatim
  261. *> THRESH is DOUBLE PRECISION
  262. *> A test will count as "failed" if the "error", computed as
  263. *> described above, exceeds THRESH. Note that the error is
  264. *> scaled to be O(1), so THRESH should be a reasonably small
  265. *> multiple of 1, e.g., 10 or 100. In particular, it should
  266. *> not depend on the precision (single vs. double) or the size
  267. *> of the matrix. THRESH >= 0.
  268. *> \endverbatim
  269. *>
  270. *> \param[in] NOUNIT
  271. *> \verbatim
  272. *> NOUNIT is INTEGER
  273. *> The FORTRAN unit number for printing out error messages
  274. *> (e.g., if a routine returns IINFO not equal to 0.)
  275. *> \endverbatim
  276. *>
  277. *> \param[in,out] A
  278. *> \verbatim
  279. *> A is DOUBLE PRECISION array,
  280. *> dimension(LDA, max(NN))
  281. *> Used to hold the original A matrix. Used as input only
  282. *> if NTYPES=MAXTYP+1, DOTYPE(1:MAXTYP)=.FALSE., and
  283. *> DOTYPE(MAXTYP+1)=.TRUE.
  284. *> \endverbatim
  285. *>
  286. *> \param[in] LDA
  287. *> \verbatim
  288. *> LDA is INTEGER
  289. *> The leading dimension of A, B, S, and T.
  290. *> It must be at least 1 and at least max( NN ).
  291. *> \endverbatim
  292. *>
  293. *> \param[in,out] B
  294. *> \verbatim
  295. *> B is DOUBLE PRECISION array,
  296. *> dimension(LDA, max(NN))
  297. *> Used to hold the original B matrix. Used as input only
  298. *> if NTYPES=MAXTYP+1, DOTYPE(1:MAXTYP)=.FALSE., and
  299. *> DOTYPE(MAXTYP+1)=.TRUE.
  300. *> \endverbatim
  301. *>
  302. *> \param[out] S
  303. *> \verbatim
  304. *> S is DOUBLE PRECISION array, dimension (LDA, max(NN))
  305. *> The Schur form matrix computed from A by DGGES. On exit, S
  306. *> contains the Schur form matrix corresponding to the matrix
  307. *> in A.
  308. *> \endverbatim
  309. *>
  310. *> \param[out] T
  311. *> \verbatim
  312. *> T is DOUBLE PRECISION array, dimension (LDA, max(NN))
  313. *> The upper triangular matrix computed from B by DGGES.
  314. *> \endverbatim
  315. *>
  316. *> \param[out] Q
  317. *> \verbatim
  318. *> Q is DOUBLE PRECISION array, dimension (LDQ, max(NN))
  319. *> The (left) orthogonal matrix computed by DGGES.
  320. *> \endverbatim
  321. *>
  322. *> \param[in] LDQ
  323. *> \verbatim
  324. *> LDQ is INTEGER
  325. *> The leading dimension of Q and Z. It must
  326. *> be at least 1 and at least max( NN ).
  327. *> \endverbatim
  328. *>
  329. *> \param[out] Z
  330. *> \verbatim
  331. *> Z is DOUBLE PRECISION array, dimension( LDQ, max(NN) )
  332. *> The (right) orthogonal matrix computed by DGGES.
  333. *> \endverbatim
  334. *>
  335. *> \param[out] ALPHAR
  336. *> \verbatim
  337. *> ALPHAR is DOUBLE PRECISION array, dimension (max(NN))
  338. *> \endverbatim
  339. *>
  340. *> \param[out] ALPHAI
  341. *> \verbatim
  342. *> ALPHAI is DOUBLE PRECISION array, dimension (max(NN))
  343. *> \endverbatim
  344. *>
  345. *> \param[out] BETA
  346. *> \verbatim
  347. *> BETA is DOUBLE PRECISION array, dimension (max(NN))
  348. *>
  349. *> The generalized eigenvalues of (A,B) computed by DGGES.
  350. *> ( ALPHAR(k)+ALPHAI(k)*i ) / BETA(k) is the k-th
  351. *> generalized eigenvalue of A and B.
  352. *> \endverbatim
  353. *>
  354. *> \param[out] WORK
  355. *> \verbatim
  356. *> WORK is DOUBLE PRECISION array, dimension (LWORK)
  357. *> \endverbatim
  358. *>
  359. *> \param[in] LWORK
  360. *> \verbatim
  361. *> LWORK is INTEGER
  362. *> The dimension of the array WORK.
  363. *> LWORK >= MAX( 10*(N+1), 3*N*N ), where N is the largest
  364. *> matrix dimension.
  365. *> \endverbatim
  366. *>
  367. *> \param[out] RESULT
  368. *> \verbatim
  369. *> RESULT is DOUBLE PRECISION array, dimension (15)
  370. *> The values computed by the tests described above.
  371. *> The values are currently limited to 1/ulp, to avoid overflow.
  372. *> \endverbatim
  373. *>
  374. *> \param[out] BWORK
  375. *> \verbatim
  376. *> BWORK is LOGICAL array, dimension (N)
  377. *> \endverbatim
  378. *>
  379. *> \param[out] INFO
  380. *> \verbatim
  381. *> INFO is INTEGER
  382. *> = 0: successful exit
  383. *> < 0: if INFO = -i, the i-th argument had an illegal value.
  384. *> > 0: A routine returned an error code. INFO is the
  385. *> absolute value of the INFO value returned.
  386. *> \endverbatim
  387. *
  388. * Authors:
  389. * ========
  390. *
  391. *> \author Univ. of Tennessee
  392. *> \author Univ. of California Berkeley
  393. *> \author Univ. of Colorado Denver
  394. *> \author NAG Ltd.
  395. *
  396. *> \date June 2016
  397. *
  398. *> \ingroup double_eig
  399. *
  400. * =====================================================================
  401. SUBROUTINE DDRGES( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
  402. $ NOUNIT, A, LDA, B, S, T, Q, LDQ, Z, ALPHAR,
  403. $ ALPHAI, BETA, WORK, LWORK, RESULT, BWORK,
  404. $ INFO )
  405. *
  406. * -- LAPACK test routine (version 3.7.0) --
  407. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  408. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  409. * June 2016
  410. *
  411. * .. Scalar Arguments ..
  412. INTEGER INFO, LDA, LDQ, LWORK, NOUNIT, NSIZES, NTYPES
  413. DOUBLE PRECISION THRESH
  414. * ..
  415. * .. Array Arguments ..
  416. LOGICAL BWORK( * ), DOTYPE( * )
  417. INTEGER ISEED( 4 ), NN( * )
  418. DOUBLE PRECISION A( LDA, * ), ALPHAI( * ), ALPHAR( * ),
  419. $ B( LDA, * ), BETA( * ), Q( LDQ, * ),
  420. $ RESULT( 13 ), S( LDA, * ), T( LDA, * ),
  421. $ WORK( * ), Z( LDQ, * )
  422. * ..
  423. *
  424. * =====================================================================
  425. *
  426. * .. Parameters ..
  427. DOUBLE PRECISION ZERO, ONE
  428. PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
  429. INTEGER MAXTYP
  430. PARAMETER ( MAXTYP = 26 )
  431. * ..
  432. * .. Local Scalars ..
  433. LOGICAL BADNN, ILABAD
  434. CHARACTER SORT
  435. INTEGER I, I1, IADD, IERR, IINFO, IN, ISORT, J, JC, JR,
  436. $ JSIZE, JTYPE, KNTEIG, MAXWRK, MINWRK, MTYPES,
  437. $ N, N1, NB, NERRS, NMATS, NMAX, NTEST, NTESTT,
  438. $ RSUB, SDIM
  439. DOUBLE PRECISION SAFMAX, SAFMIN, TEMP1, TEMP2, ULP, ULPINV
  440. * ..
  441. * .. Local Arrays ..
  442. INTEGER IASIGN( MAXTYP ), IBSIGN( MAXTYP ),
  443. $ IOLDSD( 4 ), KADD( 6 ), KAMAGN( MAXTYP ),
  444. $ KATYPE( MAXTYP ), KAZERO( MAXTYP ),
  445. $ KBMAGN( MAXTYP ), KBTYPE( MAXTYP ),
  446. $ KBZERO( MAXTYP ), KCLASS( MAXTYP ),
  447. $ KTRIAN( MAXTYP ), KZ1( 6 ), KZ2( 6 )
  448. DOUBLE PRECISION RMAGN( 0: 3 )
  449. * ..
  450. * .. External Functions ..
  451. LOGICAL DLCTES
  452. INTEGER ILAENV
  453. DOUBLE PRECISION DLAMCH, DLARND
  454. EXTERNAL DLCTES, ILAENV, DLAMCH, DLARND
  455. * ..
  456. * .. External Subroutines ..
  457. EXTERNAL ALASVM, DGET51, DGET53, DGET54, DGGES, DLABAD,
  458. $ DLACPY, DLARFG, DLASET, DLATM4, DORM2R, XERBLA
  459. * ..
  460. * .. Intrinsic Functions ..
  461. INTRINSIC ABS, DBLE, MAX, MIN, SIGN
  462. * ..
  463. * .. Data statements ..
  464. DATA KCLASS / 15*1, 10*2, 1*3 /
  465. DATA KZ1 / 0, 1, 2, 1, 3, 3 /
  466. DATA KZ2 / 0, 0, 1, 2, 1, 1 /
  467. DATA KADD / 0, 0, 0, 0, 3, 2 /
  468. DATA KATYPE / 0, 1, 0, 1, 2, 3, 4, 1, 4, 4, 1, 1, 4,
  469. $ 4, 4, 2, 4, 5, 8, 7, 9, 4*4, 0 /
  470. DATA KBTYPE / 0, 0, 1, 1, 2, -3, 1, 4, 1, 1, 4, 4,
  471. $ 1, 1, -4, 2, -4, 8*8, 0 /
  472. DATA KAZERO / 6*1, 2, 1, 2*2, 2*1, 2*2, 3, 1, 3,
  473. $ 4*5, 4*3, 1 /
  474. DATA KBZERO / 6*1, 1, 2, 2*1, 2*2, 2*1, 4, 1, 4,
  475. $ 4*6, 4*4, 1 /
  476. DATA KAMAGN / 8*1, 2, 3, 2, 3, 2, 3, 7*1, 2, 3, 3,
  477. $ 2, 1 /
  478. DATA KBMAGN / 8*1, 3, 2, 3, 2, 2, 3, 7*1, 3, 2, 3,
  479. $ 2, 1 /
  480. DATA KTRIAN / 16*0, 10*1 /
  481. DATA IASIGN / 6*0, 2, 0, 2*2, 2*0, 3*2, 0, 2, 3*0,
  482. $ 5*2, 0 /
  483. DATA IBSIGN / 7*0, 2, 2*0, 2*2, 2*0, 2, 0, 2, 9*0 /
  484. * ..
  485. * .. Executable Statements ..
  486. *
  487. * Check for errors
  488. *
  489. INFO = 0
  490. *
  491. BADNN = .FALSE.
  492. NMAX = 1
  493. DO 10 J = 1, NSIZES
  494. NMAX = MAX( NMAX, NN( J ) )
  495. IF( NN( J ).LT.0 )
  496. $ BADNN = .TRUE.
  497. 10 CONTINUE
  498. *
  499. IF( NSIZES.LT.0 ) THEN
  500. INFO = -1
  501. ELSE IF( BADNN ) THEN
  502. INFO = -2
  503. ELSE IF( NTYPES.LT.0 ) THEN
  504. INFO = -3
  505. ELSE IF( THRESH.LT.ZERO ) THEN
  506. INFO = -6
  507. ELSE IF( LDA.LE.1 .OR. LDA.LT.NMAX ) THEN
  508. INFO = -9
  509. ELSE IF( LDQ.LE.1 .OR. LDQ.LT.NMAX ) THEN
  510. INFO = -14
  511. END IF
  512. *
  513. * Compute workspace
  514. * (Note: Comments in the code beginning "Workspace:" describe the
  515. * minimal amount of workspace needed at that point in the code,
  516. * as well as the preferred amount for good performance.
  517. * NB refers to the optimal block size for the immediately
  518. * following subroutine, as returned by ILAENV.
  519. *
  520. MINWRK = 1
  521. IF( INFO.EQ.0 .AND. LWORK.GE.1 ) THEN
  522. MINWRK = MAX( 10*( NMAX+1 ), 3*NMAX*NMAX )
  523. NB = MAX( 1, ILAENV( 1, 'DGEQRF', ' ', NMAX, NMAX, -1, -1 ),
  524. $ ILAENV( 1, 'DORMQR', 'LT', NMAX, NMAX, NMAX, -1 ),
  525. $ ILAENV( 1, 'DORGQR', ' ', NMAX, NMAX, NMAX, -1 ) )
  526. MAXWRK = MAX( 10*( NMAX+1 ), 2*NMAX+NMAX*NB, 3*NMAX*NMAX )
  527. WORK( 1 ) = MAXWRK
  528. END IF
  529. *
  530. IF( LWORK.LT.MINWRK )
  531. $ INFO = -20
  532. *
  533. IF( INFO.NE.0 ) THEN
  534. CALL XERBLA( 'DDRGES', -INFO )
  535. RETURN
  536. END IF
  537. *
  538. * Quick return if possible
  539. *
  540. IF( NSIZES.EQ.0 .OR. NTYPES.EQ.0 )
  541. $ RETURN
  542. *
  543. SAFMIN = DLAMCH( 'Safe minimum' )
  544. ULP = DLAMCH( 'Epsilon' )*DLAMCH( 'Base' )
  545. SAFMIN = SAFMIN / ULP
  546. SAFMAX = ONE / SAFMIN
  547. CALL DLABAD( SAFMIN, SAFMAX )
  548. ULPINV = ONE / ULP
  549. *
  550. * The values RMAGN(2:3) depend on N, see below.
  551. *
  552. RMAGN( 0 ) = ZERO
  553. RMAGN( 1 ) = ONE
  554. *
  555. * Loop over matrix sizes
  556. *
  557. NTESTT = 0
  558. NERRS = 0
  559. NMATS = 0
  560. *
  561. DO 190 JSIZE = 1, NSIZES
  562. N = NN( JSIZE )
  563. N1 = MAX( 1, N )
  564. RMAGN( 2 ) = SAFMAX*ULP / DBLE( N1 )
  565. RMAGN( 3 ) = SAFMIN*ULPINV*DBLE( N1 )
  566. *
  567. IF( NSIZES.NE.1 ) THEN
  568. MTYPES = MIN( MAXTYP, NTYPES )
  569. ELSE
  570. MTYPES = MIN( MAXTYP+1, NTYPES )
  571. END IF
  572. *
  573. * Loop over matrix types
  574. *
  575. DO 180 JTYPE = 1, MTYPES
  576. IF( .NOT.DOTYPE( JTYPE ) )
  577. $ GO TO 180
  578. NMATS = NMATS + 1
  579. NTEST = 0
  580. *
  581. * Save ISEED in case of an error.
  582. *
  583. DO 20 J = 1, 4
  584. IOLDSD( J ) = ISEED( J )
  585. 20 CONTINUE
  586. *
  587. * Initialize RESULT
  588. *
  589. DO 30 J = 1, 13
  590. RESULT( J ) = ZERO
  591. 30 CONTINUE
  592. *
  593. * Generate test matrices A and B
  594. *
  595. * Description of control parameters:
  596. *
  597. * KZLASS: =1 means w/o rotation, =2 means w/ rotation,
  598. * =3 means random.
  599. * KATYPE: the "type" to be passed to DLATM4 for computing A.
  600. * KAZERO: the pattern of zeros on the diagonal for A:
  601. * =1: ( xxx ), =2: (0, xxx ) =3: ( 0, 0, xxx, 0 ),
  602. * =4: ( 0, xxx, 0, 0 ), =5: ( 0, 0, 1, xxx, 0 ),
  603. * =6: ( 0, 1, 0, xxx, 0 ). (xxx means a string of
  604. * non-zero entries.)
  605. * KAMAGN: the magnitude of the matrix: =0: zero, =1: O(1),
  606. * =2: large, =3: small.
  607. * IASIGN: 1 if the diagonal elements of A are to be
  608. * multiplied by a random magnitude 1 number, =2 if
  609. * randomly chosen diagonal blocks are to be rotated
  610. * to form 2x2 blocks.
  611. * KBTYPE, KBZERO, KBMAGN, IBSIGN: the same, but for B.
  612. * KTRIAN: =0: don't fill in the upper triangle, =1: do.
  613. * KZ1, KZ2, KADD: used to implement KAZERO and KBZERO.
  614. * RMAGN: used to implement KAMAGN and KBMAGN.
  615. *
  616. IF( MTYPES.GT.MAXTYP )
  617. $ GO TO 110
  618. IINFO = 0
  619. IF( KCLASS( JTYPE ).LT.3 ) THEN
  620. *
  621. * Generate A (w/o rotation)
  622. *
  623. IF( ABS( KATYPE( JTYPE ) ).EQ.3 ) THEN
  624. IN = 2*( ( N-1 ) / 2 ) + 1
  625. IF( IN.NE.N )
  626. $ CALL DLASET( 'Full', N, N, ZERO, ZERO, A, LDA )
  627. ELSE
  628. IN = N
  629. END IF
  630. CALL DLATM4( KATYPE( JTYPE ), IN, KZ1( KAZERO( JTYPE ) ),
  631. $ KZ2( KAZERO( JTYPE ) ), IASIGN( JTYPE ),
  632. $ RMAGN( KAMAGN( JTYPE ) ), ULP,
  633. $ RMAGN( KTRIAN( JTYPE )*KAMAGN( JTYPE ) ), 2,
  634. $ ISEED, A, LDA )
  635. IADD = KADD( KAZERO( JTYPE ) )
  636. IF( IADD.GT.0 .AND. IADD.LE.N )
  637. $ A( IADD, IADD ) = ONE
  638. *
  639. * Generate B (w/o rotation)
  640. *
  641. IF( ABS( KBTYPE( JTYPE ) ).EQ.3 ) THEN
  642. IN = 2*( ( N-1 ) / 2 ) + 1
  643. IF( IN.NE.N )
  644. $ CALL DLASET( 'Full', N, N, ZERO, ZERO, B, LDA )
  645. ELSE
  646. IN = N
  647. END IF
  648. CALL DLATM4( KBTYPE( JTYPE ), IN, KZ1( KBZERO( JTYPE ) ),
  649. $ KZ2( KBZERO( JTYPE ) ), IBSIGN( JTYPE ),
  650. $ RMAGN( KBMAGN( JTYPE ) ), ONE,
  651. $ RMAGN( KTRIAN( JTYPE )*KBMAGN( JTYPE ) ), 2,
  652. $ ISEED, B, LDA )
  653. IADD = KADD( KBZERO( JTYPE ) )
  654. IF( IADD.NE.0 .AND. IADD.LE.N )
  655. $ B( IADD, IADD ) = ONE
  656. *
  657. IF( KCLASS( JTYPE ).EQ.2 .AND. N.GT.0 ) THEN
  658. *
  659. * Include rotations
  660. *
  661. * Generate Q, Z as Householder transformations times
  662. * a diagonal matrix.
  663. *
  664. DO 50 JC = 1, N - 1
  665. DO 40 JR = JC, N
  666. Q( JR, JC ) = DLARND( 3, ISEED )
  667. Z( JR, JC ) = DLARND( 3, ISEED )
  668. 40 CONTINUE
  669. CALL DLARFG( N+1-JC, Q( JC, JC ), Q( JC+1, JC ), 1,
  670. $ WORK( JC ) )
  671. WORK( 2*N+JC ) = SIGN( ONE, Q( JC, JC ) )
  672. Q( JC, JC ) = ONE
  673. CALL DLARFG( N+1-JC, Z( JC, JC ), Z( JC+1, JC ), 1,
  674. $ WORK( N+JC ) )
  675. WORK( 3*N+JC ) = SIGN( ONE, Z( JC, JC ) )
  676. Z( JC, JC ) = ONE
  677. 50 CONTINUE
  678. Q( N, N ) = ONE
  679. WORK( N ) = ZERO
  680. WORK( 3*N ) = SIGN( ONE, DLARND( 2, ISEED ) )
  681. Z( N, N ) = ONE
  682. WORK( 2*N ) = ZERO
  683. WORK( 4*N ) = SIGN( ONE, DLARND( 2, ISEED ) )
  684. *
  685. * Apply the diagonal matrices
  686. *
  687. DO 70 JC = 1, N
  688. DO 60 JR = 1, N
  689. A( JR, JC ) = WORK( 2*N+JR )*WORK( 3*N+JC )*
  690. $ A( JR, JC )
  691. B( JR, JC ) = WORK( 2*N+JR )*WORK( 3*N+JC )*
  692. $ B( JR, JC )
  693. 60 CONTINUE
  694. 70 CONTINUE
  695. CALL DORM2R( 'L', 'N', N, N, N-1, Q, LDQ, WORK, A,
  696. $ LDA, WORK( 2*N+1 ), IINFO )
  697. IF( IINFO.NE.0 )
  698. $ GO TO 100
  699. CALL DORM2R( 'R', 'T', N, N, N-1, Z, LDQ, WORK( N+1 ),
  700. $ A, LDA, WORK( 2*N+1 ), IINFO )
  701. IF( IINFO.NE.0 )
  702. $ GO TO 100
  703. CALL DORM2R( 'L', 'N', N, N, N-1, Q, LDQ, WORK, B,
  704. $ LDA, WORK( 2*N+1 ), IINFO )
  705. IF( IINFO.NE.0 )
  706. $ GO TO 100
  707. CALL DORM2R( 'R', 'T', N, N, N-1, Z, LDQ, WORK( N+1 ),
  708. $ B, LDA, WORK( 2*N+1 ), IINFO )
  709. IF( IINFO.NE.0 )
  710. $ GO TO 100
  711. END IF
  712. ELSE
  713. *
  714. * Random matrices
  715. *
  716. DO 90 JC = 1, N
  717. DO 80 JR = 1, N
  718. A( JR, JC ) = RMAGN( KAMAGN( JTYPE ) )*
  719. $ DLARND( 2, ISEED )
  720. B( JR, JC ) = RMAGN( KBMAGN( JTYPE ) )*
  721. $ DLARND( 2, ISEED )
  722. 80 CONTINUE
  723. 90 CONTINUE
  724. END IF
  725. *
  726. 100 CONTINUE
  727. *
  728. IF( IINFO.NE.0 ) THEN
  729. WRITE( NOUNIT, FMT = 9999 )'Generator', IINFO, N, JTYPE,
  730. $ IOLDSD
  731. INFO = ABS( IINFO )
  732. RETURN
  733. END IF
  734. *
  735. 110 CONTINUE
  736. *
  737. DO 120 I = 1, 13
  738. RESULT( I ) = -ONE
  739. 120 CONTINUE
  740. *
  741. * Test with and without sorting of eigenvalues
  742. *
  743. DO 150 ISORT = 0, 1
  744. IF( ISORT.EQ.0 ) THEN
  745. SORT = 'N'
  746. RSUB = 0
  747. ELSE
  748. SORT = 'S'
  749. RSUB = 5
  750. END IF
  751. *
  752. * Call DGGES to compute H, T, Q, Z, alpha, and beta.
  753. *
  754. CALL DLACPY( 'Full', N, N, A, LDA, S, LDA )
  755. CALL DLACPY( 'Full', N, N, B, LDA, T, LDA )
  756. NTEST = 1 + RSUB + ISORT
  757. RESULT( 1+RSUB+ISORT ) = ULPINV
  758. CALL DGGES( 'V', 'V', SORT, DLCTES, N, S, LDA, T, LDA,
  759. $ SDIM, ALPHAR, ALPHAI, BETA, Q, LDQ, Z, LDQ,
  760. $ WORK, LWORK, BWORK, IINFO )
  761. IF( IINFO.NE.0 .AND. IINFO.NE.N+2 ) THEN
  762. RESULT( 1+RSUB+ISORT ) = ULPINV
  763. WRITE( NOUNIT, FMT = 9999 )'DGGES', IINFO, N, JTYPE,
  764. $ IOLDSD
  765. INFO = ABS( IINFO )
  766. GO TO 160
  767. END IF
  768. *
  769. NTEST = 4 + RSUB
  770. *
  771. * Do tests 1--4 (or tests 7--9 when reordering )
  772. *
  773. IF( ISORT.EQ.0 ) THEN
  774. CALL DGET51( 1, N, A, LDA, S, LDA, Q, LDQ, Z, LDQ,
  775. $ WORK, RESULT( 1 ) )
  776. CALL DGET51( 1, N, B, LDA, T, LDA, Q, LDQ, Z, LDQ,
  777. $ WORK, RESULT( 2 ) )
  778. ELSE
  779. CALL DGET54( N, A, LDA, B, LDA, S, LDA, T, LDA, Q,
  780. $ LDQ, Z, LDQ, WORK, RESULT( 7 ) )
  781. END IF
  782. CALL DGET51( 3, N, A, LDA, T, LDA, Q, LDQ, Q, LDQ, WORK,
  783. $ RESULT( 3+RSUB ) )
  784. CALL DGET51( 3, N, B, LDA, T, LDA, Z, LDQ, Z, LDQ, WORK,
  785. $ RESULT( 4+RSUB ) )
  786. *
  787. * Do test 5 and 6 (or Tests 10 and 11 when reordering):
  788. * check Schur form of A and compare eigenvalues with
  789. * diagonals.
  790. *
  791. NTEST = 6 + RSUB
  792. TEMP1 = ZERO
  793. *
  794. DO 130 J = 1, N
  795. ILABAD = .FALSE.
  796. IF( ALPHAI( J ).EQ.ZERO ) THEN
  797. TEMP2 = ( ABS( ALPHAR( J )-S( J, J ) ) /
  798. $ MAX( SAFMIN, ABS( ALPHAR( J ) ), ABS( S( J,
  799. $ J ) ) )+ABS( BETA( J )-T( J, J ) ) /
  800. $ MAX( SAFMIN, ABS( BETA( J ) ), ABS( T( J,
  801. $ J ) ) ) ) / ULP
  802. *
  803. IF( J.LT.N ) THEN
  804. IF( S( J+1, J ).NE.ZERO ) THEN
  805. ILABAD = .TRUE.
  806. RESULT( 5+RSUB ) = ULPINV
  807. END IF
  808. END IF
  809. IF( J.GT.1 ) THEN
  810. IF( S( J, J-1 ).NE.ZERO ) THEN
  811. ILABAD = .TRUE.
  812. RESULT( 5+RSUB ) = ULPINV
  813. END IF
  814. END IF
  815. *
  816. ELSE
  817. IF( ALPHAI( J ).GT.ZERO ) THEN
  818. I1 = J
  819. ELSE
  820. I1 = J - 1
  821. END IF
  822. IF( I1.LE.0 .OR. I1.GE.N ) THEN
  823. ILABAD = .TRUE.
  824. ELSE IF( I1.LT.N-1 ) THEN
  825. IF( S( I1+2, I1+1 ).NE.ZERO ) THEN
  826. ILABAD = .TRUE.
  827. RESULT( 5+RSUB ) = ULPINV
  828. END IF
  829. ELSE IF( I1.GT.1 ) THEN
  830. IF( S( I1, I1-1 ).NE.ZERO ) THEN
  831. ILABAD = .TRUE.
  832. RESULT( 5+RSUB ) = ULPINV
  833. END IF
  834. END IF
  835. IF( .NOT.ILABAD ) THEN
  836. CALL DGET53( S( I1, I1 ), LDA, T( I1, I1 ), LDA,
  837. $ BETA( J ), ALPHAR( J ),
  838. $ ALPHAI( J ), TEMP2, IERR )
  839. IF( IERR.GE.3 ) THEN
  840. WRITE( NOUNIT, FMT = 9998 )IERR, J, N,
  841. $ JTYPE, IOLDSD
  842. INFO = ABS( IERR )
  843. END IF
  844. ELSE
  845. TEMP2 = ULPINV
  846. END IF
  847. *
  848. END IF
  849. TEMP1 = MAX( TEMP1, TEMP2 )
  850. IF( ILABAD ) THEN
  851. WRITE( NOUNIT, FMT = 9997 )J, N, JTYPE, IOLDSD
  852. END IF
  853. 130 CONTINUE
  854. RESULT( 6+RSUB ) = TEMP1
  855. *
  856. IF( ISORT.GE.1 ) THEN
  857. *
  858. * Do test 12
  859. *
  860. NTEST = 12
  861. RESULT( 12 ) = ZERO
  862. KNTEIG = 0
  863. DO 140 I = 1, N
  864. IF( DLCTES( ALPHAR( I ), ALPHAI( I ),
  865. $ BETA( I ) ) .OR. DLCTES( ALPHAR( I ),
  866. $ -ALPHAI( I ), BETA( I ) ) ) THEN
  867. KNTEIG = KNTEIG + 1
  868. END IF
  869. IF( I.LT.N ) THEN
  870. IF( ( DLCTES( ALPHAR( I+1 ), ALPHAI( I+1 ),
  871. $ BETA( I+1 ) ) .OR. DLCTES( ALPHAR( I+1 ),
  872. $ -ALPHAI( I+1 ), BETA( I+1 ) ) ) .AND.
  873. $ ( .NOT.( DLCTES( ALPHAR( I ), ALPHAI( I ),
  874. $ BETA( I ) ) .OR. DLCTES( ALPHAR( I ),
  875. $ -ALPHAI( I ), BETA( I ) ) ) ) .AND.
  876. $ IINFO.NE.N+2 ) THEN
  877. RESULT( 12 ) = ULPINV
  878. END IF
  879. END IF
  880. 140 CONTINUE
  881. IF( SDIM.NE.KNTEIG ) THEN
  882. RESULT( 12 ) = ULPINV
  883. END IF
  884. END IF
  885. *
  886. 150 CONTINUE
  887. *
  888. * End of Loop -- Check for RESULT(j) > THRESH
  889. *
  890. 160 CONTINUE
  891. *
  892. NTESTT = NTESTT + NTEST
  893. *
  894. * Print out tests which fail.
  895. *
  896. DO 170 JR = 1, NTEST
  897. IF( RESULT( JR ).GE.THRESH ) THEN
  898. *
  899. * If this is the first test to fail,
  900. * print a header to the data file.
  901. *
  902. IF( NERRS.EQ.0 ) THEN
  903. WRITE( NOUNIT, FMT = 9996 )'DGS'
  904. *
  905. * Matrix types
  906. *
  907. WRITE( NOUNIT, FMT = 9995 )
  908. WRITE( NOUNIT, FMT = 9994 )
  909. WRITE( NOUNIT, FMT = 9993 )'Orthogonal'
  910. *
  911. * Tests performed
  912. *
  913. WRITE( NOUNIT, FMT = 9992 )'orthogonal', '''',
  914. $ 'transpose', ( '''', J = 1, 8 )
  915. *
  916. END IF
  917. NERRS = NERRS + 1
  918. IF( RESULT( JR ).LT.10000.0D0 ) THEN
  919. WRITE( NOUNIT, FMT = 9991 )N, JTYPE, IOLDSD, JR,
  920. $ RESULT( JR )
  921. ELSE
  922. WRITE( NOUNIT, FMT = 9990 )N, JTYPE, IOLDSD, JR,
  923. $ RESULT( JR )
  924. END IF
  925. END IF
  926. 170 CONTINUE
  927. *
  928. 180 CONTINUE
  929. 190 CONTINUE
  930. *
  931. * Summary
  932. *
  933. CALL ALASVM( 'DGS', NOUNIT, NERRS, NTESTT, 0 )
  934. *
  935. WORK( 1 ) = MAXWRK
  936. *
  937. RETURN
  938. *
  939. 9999 FORMAT( ' DDRGES: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
  940. $ I6, ', JTYPE=', I6, ', ISEED=(', 4( I4, ',' ), I5, ')' )
  941. *
  942. 9998 FORMAT( ' DDRGES: DGET53 returned INFO=', I1, ' for eigenvalue ',
  943. $ I6, '.', / 9X, 'N=', I6, ', JTYPE=', I6, ', ISEED=(',
  944. $ 4( I4, ',' ), I5, ')' )
  945. *
  946. 9997 FORMAT( ' DDRGES: S not in Schur form at eigenvalue ', I6, '.',
  947. $ / 9X, 'N=', I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ),
  948. $ I5, ')' )
  949. *
  950. 9996 FORMAT( / 1X, A3, ' -- Real Generalized Schur form driver' )
  951. *
  952. 9995 FORMAT( ' Matrix types (see DDRGES for details): ' )
  953. *
  954. 9994 FORMAT( ' Special Matrices:', 23X,
  955. $ '(J''=transposed Jordan block)',
  956. $ / ' 1=(0,0) 2=(I,0) 3=(0,I) 4=(I,I) 5=(J'',J'') ',
  957. $ '6=(diag(J'',I), diag(I,J''))', / ' Diagonal Matrices: ( ',
  958. $ 'D=diag(0,1,2,...) )', / ' 7=(D,I) 9=(large*D, small*I',
  959. $ ') 11=(large*I, small*D) 13=(large*D, large*I)', /
  960. $ ' 8=(I,D) 10=(small*D, large*I) 12=(small*I, large*D) ',
  961. $ ' 14=(small*D, small*I)', / ' 15=(D, reversed D)' )
  962. 9993 FORMAT( ' Matrices Rotated by Random ', A, ' Matrices U, V:',
  963. $ / ' 16=Transposed Jordan Blocks 19=geometric ',
  964. $ 'alpha, beta=0,1', / ' 17=arithm. alpha&beta ',
  965. $ ' 20=arithmetic alpha, beta=0,1', / ' 18=clustered ',
  966. $ 'alpha, beta=0,1 21=random alpha, beta=0,1',
  967. $ / ' Large & Small Matrices:', / ' 22=(large, small) ',
  968. $ '23=(small,large) 24=(small,small) 25=(large,large)',
  969. $ / ' 26=random O(1) matrices.' )
  970. *
  971. 9992 FORMAT( / ' Tests performed: (S is Schur, T is triangular, ',
  972. $ 'Q and Z are ', A, ',', / 19X,
  973. $ 'l and r are the appropriate left and right', / 19X,
  974. $ 'eigenvectors, resp., a is alpha, b is beta, and', / 19X, A,
  975. $ ' means ', A, '.)', / ' Without ordering: ',
  976. $ / ' 1 = | A - Q S Z', A,
  977. $ ' | / ( |A| n ulp ) 2 = | B - Q T Z', A,
  978. $ ' | / ( |B| n ulp )', / ' 3 = | I - QQ', A,
  979. $ ' | / ( n ulp ) 4 = | I - ZZ', A,
  980. $ ' | / ( n ulp )', / ' 5 = A is in Schur form S',
  981. $ / ' 6 = difference between (alpha,beta)',
  982. $ ' and diagonals of (S,T)', / ' With ordering: ',
  983. $ / ' 7 = | (A,B) - Q (S,T) Z', A,
  984. $ ' | / ( |(A,B)| n ulp ) ', / ' 8 = | I - QQ', A,
  985. $ ' | / ( n ulp ) 9 = | I - ZZ', A,
  986. $ ' | / ( n ulp )', / ' 10 = A is in Schur form S',
  987. $ / ' 11 = difference between (alpha,beta) and diagonals',
  988. $ ' of (S,T)', / ' 12 = SDIM is the correct number of ',
  989. $ 'selected eigenvalues', / )
  990. 9991 FORMAT( ' Matrix order=', I5, ', type=', I2, ', seed=',
  991. $ 4( I4, ',' ), ' result ', I2, ' is', 0P, F8.2 )
  992. 9990 FORMAT( ' Matrix order=', I5, ', type=', I2, ', seed=',
  993. $ 4( I4, ',' ), ' result ', I2, ' is', 1P, D10.3 )
  994. *
  995. * End of DDRGES
  996. *
  997. END