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.

dchkst2stg.f 72 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061
  1. *> \brief \b DCHKST2STG
  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 DCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
  12. * NOUNIT, A, LDA, AP, SD, SE, D1, D2, D3, D4, D5,
  13. * WA1, WA2, WA3, WR, U, LDU, V, VP, TAU, Z, WORK,
  14. * LWORK, IWORK, LIWORK, RESULT, INFO )
  15. *
  16. * .. Scalar Arguments ..
  17. * INTEGER INFO, LDA, LDU, LIWORK, LWORK, NOUNIT, NSIZES,
  18. * $ NTYPES
  19. * DOUBLE PRECISION THRESH
  20. * ..
  21. * .. Array Arguments ..
  22. * LOGICAL DOTYPE( * )
  23. * INTEGER ISEED( 4 ), IWORK( * ), NN( * )
  24. * DOUBLE PRECISION A( LDA, * ), AP( * ), D1( * ), D2( * ),
  25. * $ D3( * ), D4( * ), D5( * ), RESULT( * ),
  26. * $ SD( * ), SE( * ), TAU( * ), U( LDU, * ),
  27. * $ V( LDU, * ), VP( * ), WA1( * ), WA2( * ),
  28. * $ WA3( * ), WORK( * ), WR( * ), Z( LDU, * )
  29. * ..
  30. *
  31. *
  32. *> \par Purpose:
  33. * =============
  34. *>
  35. *> \verbatim
  36. *>
  37. *> DCHKST2STG checks the symmetric eigenvalue problem routines
  38. *> using the 2-stage reduction techniques. Since the generation
  39. *> of Q or the vectors is not available in this release, we only
  40. *> compare the eigenvalue resulting when using the 2-stage to the
  41. *> one considered as reference using the standard 1-stage reduction
  42. *> DSYTRD. For that, we call the standard DSYTRD and compute D1 using
  43. *> DSTEQR, then we call the 2-stage DSYTRD_2STAGE with Upper and Lower
  44. *> and we compute D2 and D3 using DSTEQR and then we replaced tests
  45. *> 3 and 4 by tests 11 and 12. test 1 and 2 remain to verify that
  46. *> the 1-stage results are OK and can be trusted.
  47. *> This testing routine will converge to the DCHKST in the next
  48. *> release when vectors and generation of Q will be implemented.
  49. *>
  50. *> DSYTRD factors A as U S U' , where ' means transpose,
  51. *> S is symmetric tridiagonal, and U is orthogonal.
  52. *> DSYTRD can use either just the lower or just the upper triangle
  53. *> of A; DCHKST2STG checks both cases.
  54. *> U is represented as a product of Householder
  55. *> transformations, whose vectors are stored in the first
  56. *> n-1 columns of V, and whose scale factors are in TAU.
  57. *>
  58. *> DSPTRD does the same as DSYTRD, except that A and V are stored
  59. *> in "packed" format.
  60. *>
  61. *> DORGTR constructs the matrix U from the contents of V and TAU.
  62. *>
  63. *> DOPGTR constructs the matrix U from the contents of VP and TAU.
  64. *>
  65. *> DSTEQR factors S as Z D1 Z' , where Z is the orthogonal
  66. *> matrix of eigenvectors and D1 is a diagonal matrix with
  67. *> the eigenvalues on the diagonal. D2 is the matrix of
  68. *> eigenvalues computed when Z is not computed.
  69. *>
  70. *> DSTERF computes D3, the matrix of eigenvalues, by the
  71. *> PWK method, which does not yield eigenvectors.
  72. *>
  73. *> DPTEQR factors S as Z4 D4 Z4' , for a
  74. *> symmetric positive definite tridiagonal matrix.
  75. *> D5 is the matrix of eigenvalues computed when Z is not
  76. *> computed.
  77. *>
  78. *> DSTEBZ computes selected eigenvalues. WA1, WA2, and
  79. *> WA3 will denote eigenvalues computed to high
  80. *> absolute accuracy, with different range options.
  81. *> WR will denote eigenvalues computed to high relative
  82. *> accuracy.
  83. *>
  84. *> DSTEIN computes Y, the eigenvectors of S, given the
  85. *> eigenvalues.
  86. *>
  87. *> DSTEDC factors S as Z D1 Z' , where Z is the orthogonal
  88. *> matrix of eigenvectors and D1 is a diagonal matrix with
  89. *> the eigenvalues on the diagonal ('I' option). It may also
  90. *> update an input orthogonal matrix, usually the output
  91. *> from DSYTRD/DORGTR or DSPTRD/DOPGTR ('V' option). It may
  92. *> also just compute eigenvalues ('N' option).
  93. *>
  94. *> DSTEMR factors S as Z D1 Z' , where Z is the orthogonal
  95. *> matrix of eigenvectors and D1 is a diagonal matrix with
  96. *> the eigenvalues on the diagonal ('I' option). DSTEMR
  97. *> uses the Relatively Robust Representation whenever possible.
  98. *>
  99. *> When DCHKST2STG is called, a number of matrix "sizes" ("n's") and a
  100. *> number of matrix "types" are specified. For each size ("n")
  101. *> and each type of matrix, one matrix will be generated and used
  102. *> to test the symmetric eigenroutines. For each matrix, a number
  103. *> of tests will be performed:
  104. *>
  105. *> (1) | A - V S V' | / ( |A| n ulp ) DSYTRD( UPLO='U', ... )
  106. *>
  107. *> (2) | I - UV' | / ( n ulp ) DORGTR( UPLO='U', ... )
  108. *>
  109. *> (3) | A - V S V' | / ( |A| n ulp ) DSYTRD( UPLO='L', ... )
  110. *> replaced by | D1 - D2 | / ( |D1| ulp ) where D1 is the
  111. *> eigenvalue matrix computed using S and D2 is the
  112. *> eigenvalue matrix computed using S_2stage the output of
  113. *> DSYTRD_2STAGE("N", "U",....). D1 and D2 are computed
  114. *> via DSTEQR('N',...)
  115. *>
  116. *> (4) | I - UV' | / ( n ulp ) DORGTR( UPLO='L', ... )
  117. *> replaced by | D1 - D3 | / ( |D1| ulp ) where D1 is the
  118. *> eigenvalue matrix computed using S and D3 is the
  119. *> eigenvalue matrix computed using S_2stage the output of
  120. *> DSYTRD_2STAGE("N", "L",....). D1 and D3 are computed
  121. *> via DSTEQR('N',...)
  122. *>
  123. *> (5-8) Same as 1-4, but for DSPTRD and DOPGTR.
  124. *>
  125. *> (9) | S - Z D Z' | / ( |S| n ulp ) DSTEQR('V',...)
  126. *>
  127. *> (10) | I - ZZ' | / ( n ulp ) DSTEQR('V',...)
  128. *>
  129. *> (11) | D1 - D2 | / ( |D1| ulp ) DSTEQR('N',...)
  130. *>
  131. *> (12) | D1 - D3 | / ( |D1| ulp ) DSTERF
  132. *>
  133. *> (13) 0 if the true eigenvalues (computed by sturm count)
  134. *> of S are within THRESH of
  135. *> those in D1. 2*THRESH if they are not. (Tested using
  136. *> DSTECH)
  137. *>
  138. *> For S positive definite,
  139. *>
  140. *> (14) | S - Z4 D4 Z4' | / ( |S| n ulp ) DPTEQR('V',...)
  141. *>
  142. *> (15) | I - Z4 Z4' | / ( n ulp ) DPTEQR('V',...)
  143. *>
  144. *> (16) | D4 - D5 | / ( 100 |D4| ulp ) DPTEQR('N',...)
  145. *>
  146. *> When S is also diagonally dominant by the factor gamma < 1,
  147. *>
  148. *> (17) max | D4(i) - WR(i) | / ( |D4(i)| omega ) ,
  149. *> i
  150. *> omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
  151. *> DSTEBZ( 'A', 'E', ...)
  152. *>
  153. *> (18) | WA1 - D3 | / ( |D3| ulp ) DSTEBZ( 'A', 'E', ...)
  154. *>
  155. *> (19) ( max { min | WA2(i)-WA3(j) | } +
  156. *> i j
  157. *> max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
  158. *> i j
  159. *> DSTEBZ( 'I', 'E', ...)
  160. *>
  161. *> (20) | S - Y WA1 Y' | / ( |S| n ulp ) DSTEBZ, SSTEIN
  162. *>
  163. *> (21) | I - Y Y' | / ( n ulp ) DSTEBZ, SSTEIN
  164. *>
  165. *> (22) | S - Z D Z' | / ( |S| n ulp ) DSTEDC('I')
  166. *>
  167. *> (23) | I - ZZ' | / ( n ulp ) DSTEDC('I')
  168. *>
  169. *> (24) | S - Z D Z' | / ( |S| n ulp ) DSTEDC('V')
  170. *>
  171. *> (25) | I - ZZ' | / ( n ulp ) DSTEDC('V')
  172. *>
  173. *> (26) | D1 - D2 | / ( |D1| ulp ) DSTEDC('V') and
  174. *> DSTEDC('N')
  175. *>
  176. *> Test 27 is disabled at the moment because DSTEMR does not
  177. *> guarantee high relatvie accuracy.
  178. *>
  179. *> (27) max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
  180. *> i
  181. *> omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
  182. *> DSTEMR('V', 'A')
  183. *>
  184. *> (28) max | D6(i) - WR(i) | / ( |D6(i)| omega ) ,
  185. *> i
  186. *> omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4
  187. *> DSTEMR('V', 'I')
  188. *>
  189. *> Tests 29 through 34 are disable at present because DSTEMR
  190. *> does not handle partial spectrum requests.
  191. *>
  192. *> (29) | S - Z D Z' | / ( |S| n ulp ) DSTEMR('V', 'I')
  193. *>
  194. *> (30) | I - ZZ' | / ( n ulp ) DSTEMR('V', 'I')
  195. *>
  196. *> (31) ( max { min | WA2(i)-WA3(j) | } +
  197. *> i j
  198. *> max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
  199. *> i j
  200. *> DSTEMR('N', 'I') vs. SSTEMR('V', 'I')
  201. *>
  202. *> (32) | S - Z D Z' | / ( |S| n ulp ) DSTEMR('V', 'V')
  203. *>
  204. *> (33) | I - ZZ' | / ( n ulp ) DSTEMR('V', 'V')
  205. *>
  206. *> (34) ( max { min | WA2(i)-WA3(j) | } +
  207. *> i j
  208. *> max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
  209. *> i j
  210. *> DSTEMR('N', 'V') vs. SSTEMR('V', 'V')
  211. *>
  212. *> (35) | S - Z D Z' | / ( |S| n ulp ) DSTEMR('V', 'A')
  213. *>
  214. *> (36) | I - ZZ' | / ( n ulp ) DSTEMR('V', 'A')
  215. *>
  216. *> (37) ( max { min | WA2(i)-WA3(j) | } +
  217. *> i j
  218. *> max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp )
  219. *> i j
  220. *> DSTEMR('N', 'A') vs. SSTEMR('V', 'A')
  221. *>
  222. *> The "sizes" are specified by an array NN(1:NSIZES); the value of
  223. *> each element NN(j) specifies one size.
  224. *> The "types" are specified by a logical array DOTYPE( 1:NTYPES );
  225. *> if DOTYPE(j) is .TRUE., then matrix type "j" will be generated.
  226. *> Currently, the list of possible types is:
  227. *>
  228. *> (1) The zero matrix.
  229. *> (2) The identity matrix.
  230. *>
  231. *> (3) A diagonal matrix with evenly spaced entries
  232. *> 1, ..., ULP and random signs.
  233. *> (ULP = (first number larger than 1) - 1 )
  234. *> (4) A diagonal matrix with geometrically spaced entries
  235. *> 1, ..., ULP and random signs.
  236. *> (5) A diagonal matrix with "clustered" entries 1, ULP, ..., ULP
  237. *> and random signs.
  238. *>
  239. *> (6) Same as (4), but multiplied by SQRT( overflow threshold )
  240. *> (7) Same as (4), but multiplied by SQRT( underflow threshold )
  241. *>
  242. *> (8) A matrix of the form U' D U, where U is orthogonal and
  243. *> D has evenly spaced entries 1, ..., ULP with random signs
  244. *> on the diagonal.
  245. *>
  246. *> (9) A matrix of the form U' D U, where U is orthogonal and
  247. *> D has geometrically spaced entries 1, ..., ULP with random
  248. *> signs on the diagonal.
  249. *>
  250. *> (10) A matrix of the form U' D U, where U is orthogonal and
  251. *> D has "clustered" entries 1, ULP,..., ULP with random
  252. *> signs on the diagonal.
  253. *>
  254. *> (11) Same as (8), but multiplied by SQRT( overflow threshold )
  255. *> (12) Same as (8), but multiplied by SQRT( underflow threshold )
  256. *>
  257. *> (13) Symmetric matrix with random entries chosen from (-1,1).
  258. *> (14) Same as (13), but multiplied by SQRT( overflow threshold )
  259. *> (15) Same as (13), but multiplied by SQRT( underflow threshold )
  260. *> (16) Same as (8), but diagonal elements are all positive.
  261. *> (17) Same as (9), but diagonal elements are all positive.
  262. *> (18) Same as (10), but diagonal elements are all positive.
  263. *> (19) Same as (16), but multiplied by SQRT( overflow threshold )
  264. *> (20) Same as (16), but multiplied by SQRT( underflow threshold )
  265. *> (21) A diagonally dominant tridiagonal matrix with geometrically
  266. *> spaced diagonal entries 1, ..., ULP.
  267. *> \endverbatim
  268. *
  269. * Arguments:
  270. * ==========
  271. *
  272. *> \param[in] NSIZES
  273. *> \verbatim
  274. *> NSIZES is INTEGER
  275. *> The number of sizes of matrices to use. If it is zero,
  276. *> DCHKST2STG does nothing. It must be at least zero.
  277. *> \endverbatim
  278. *>
  279. *> \param[in] NN
  280. *> \verbatim
  281. *> NN is INTEGER array, dimension (NSIZES)
  282. *> An array containing the sizes to be used for the matrices.
  283. *> Zero values will be skipped. The values must be at least
  284. *> zero.
  285. *> \endverbatim
  286. *>
  287. *> \param[in] NTYPES
  288. *> \verbatim
  289. *> NTYPES is INTEGER
  290. *> The number of elements in DOTYPE. If it is zero, DCHKST2STG
  291. *> does nothing. It must be at least zero. If it is MAXTYP+1
  292. *> and NSIZES is 1, then an additional type, MAXTYP+1 is
  293. *> defined, which is to use whatever matrix is in A. This
  294. *> is only useful if DOTYPE(1:MAXTYP) is .FALSE. and
  295. *> DOTYPE(MAXTYP+1) is .TRUE. .
  296. *> \endverbatim
  297. *>
  298. *> \param[in] DOTYPE
  299. *> \verbatim
  300. *> DOTYPE is LOGICAL array, dimension (NTYPES)
  301. *> If DOTYPE(j) is .TRUE., then for each size in NN a
  302. *> matrix of that size and of type j will be generated.
  303. *> If NTYPES is smaller than the maximum number of types
  304. *> defined (PARAMETER MAXTYP), then types NTYPES+1 through
  305. *> MAXTYP will not be generated. If NTYPES is larger
  306. *> than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES)
  307. *> will be ignored.
  308. *> \endverbatim
  309. *>
  310. *> \param[in,out] ISEED
  311. *> \verbatim
  312. *> ISEED is INTEGER array, dimension (4)
  313. *> On entry ISEED specifies the seed of the random number
  314. *> generator. The array elements should be between 0 and 4095;
  315. *> if not they will be reduced mod 4096. Also, ISEED(4) must
  316. *> be odd. The random number generator uses a linear
  317. *> congruential sequence limited to small integers, and so
  318. *> should produce machine independent random numbers. The
  319. *> values of ISEED are changed on exit, and can be used in the
  320. *> next call to DCHKST2STG to continue the same random number
  321. *> sequence.
  322. *> \endverbatim
  323. *>
  324. *> \param[in] THRESH
  325. *> \verbatim
  326. *> THRESH is DOUBLE PRECISION
  327. *> A test will count as "failed" if the "error", computed as
  328. *> described above, exceeds THRESH. Note that the error
  329. *> is scaled to be O(1), so THRESH should be a reasonably
  330. *> small multiple of 1, e.g., 10 or 100. In particular,
  331. *> it should not depend on the precision (single vs. double)
  332. *> or the size of the matrix. It must be at least zero.
  333. *> \endverbatim
  334. *>
  335. *> \param[in] NOUNIT
  336. *> \verbatim
  337. *> NOUNIT is INTEGER
  338. *> The FORTRAN unit number for printing out error messages
  339. *> (e.g., if a routine returns IINFO not equal to 0.)
  340. *> \endverbatim
  341. *>
  342. *> \param[in,out] A
  343. *> \verbatim
  344. *> A is DOUBLE PRECISION array of
  345. *> dimension ( LDA , max(NN) )
  346. *> Used to hold the matrix whose eigenvalues are to be
  347. *> computed. On exit, A contains the last matrix actually
  348. *> used.
  349. *> \endverbatim
  350. *>
  351. *> \param[in] LDA
  352. *> \verbatim
  353. *> LDA is INTEGER
  354. *> The leading dimension of A. It must be at
  355. *> least 1 and at least max( NN ).
  356. *> \endverbatim
  357. *>
  358. *> \param[out] AP
  359. *> \verbatim
  360. *> AP is DOUBLE PRECISION array of
  361. *> dimension( max(NN)*max(NN+1)/2 )
  362. *> The matrix A stored in packed format.
  363. *> \endverbatim
  364. *>
  365. *> \param[out] SD
  366. *> \verbatim
  367. *> SD is DOUBLE PRECISION array of
  368. *> dimension( max(NN) )
  369. *> The diagonal of the tridiagonal matrix computed by DSYTRD.
  370. *> On exit, SD and SE contain the tridiagonal form of the
  371. *> matrix in A.
  372. *> \endverbatim
  373. *>
  374. *> \param[out] SE
  375. *> \verbatim
  376. *> SE is DOUBLE PRECISION array of
  377. *> dimension( max(NN) )
  378. *> The off-diagonal of the tridiagonal matrix computed by
  379. *> DSYTRD. On exit, SD and SE contain the tridiagonal form of
  380. *> the matrix in A.
  381. *> \endverbatim
  382. *>
  383. *> \param[out] D1
  384. *> \verbatim
  385. *> D1 is DOUBLE PRECISION array of
  386. *> dimension( max(NN) )
  387. *> The eigenvalues of A, as computed by DSTEQR simlutaneously
  388. *> with Z. On exit, the eigenvalues in D1 correspond with the
  389. *> matrix in A.
  390. *> \endverbatim
  391. *>
  392. *> \param[out] D2
  393. *> \verbatim
  394. *> D2 is DOUBLE PRECISION array of
  395. *> dimension( max(NN) )
  396. *> The eigenvalues of A, as computed by DSTEQR if Z is not
  397. *> computed. On exit, the eigenvalues in D2 correspond with
  398. *> the matrix in A.
  399. *> \endverbatim
  400. *>
  401. *> \param[out] D3
  402. *> \verbatim
  403. *> D3 is DOUBLE PRECISION array of
  404. *> dimension( max(NN) )
  405. *> The eigenvalues of A, as computed by DSTERF. On exit, the
  406. *> eigenvalues in D3 correspond with the matrix in A.
  407. *> \endverbatim
  408. *>
  409. *> \param[out] D4
  410. *> \verbatim
  411. *> D4 is DOUBLE PRECISION array of
  412. *> dimension( max(NN) )
  413. *> The eigenvalues of A, as computed by DPTEQR(V).
  414. *> DPTEQR factors S as Z4 D4 Z4*
  415. *> On exit, the eigenvalues in D4 correspond with the matrix in A.
  416. *> \endverbatim
  417. *>
  418. *> \param[out] D5
  419. *> \verbatim
  420. *> D5 is DOUBLE PRECISION array of
  421. *> dimension( max(NN) )
  422. *> The eigenvalues of A, as computed by DPTEQR(N)
  423. *> when Z is not computed. On exit, the
  424. *> eigenvalues in D4 correspond with the matrix in A.
  425. *> \endverbatim
  426. *>
  427. *> \param[out] WA1
  428. *> \verbatim
  429. *> WA1 is DOUBLE PRECISION array of
  430. *> dimension( max(NN) )
  431. *> All eigenvalues of A, computed to high
  432. *> absolute accuracy, with different range options.
  433. *> as computed by DSTEBZ.
  434. *> \endverbatim
  435. *>
  436. *> \param[out] WA2
  437. *> \verbatim
  438. *> WA2 is DOUBLE PRECISION array of
  439. *> dimension( max(NN) )
  440. *> Selected eigenvalues of A, computed to high
  441. *> absolute accuracy, with different range options.
  442. *> as computed by DSTEBZ.
  443. *> Choose random values for IL and IU, and ask for the
  444. *> IL-th through IU-th eigenvalues.
  445. *> \endverbatim
  446. *>
  447. *> \param[out] WA3
  448. *> \verbatim
  449. *> WA3 is DOUBLE PRECISION array of
  450. *> dimension( max(NN) )
  451. *> Selected eigenvalues of A, computed to high
  452. *> absolute accuracy, with different range options.
  453. *> as computed by DSTEBZ.
  454. *> Determine the values VL and VU of the IL-th and IU-th
  455. *> eigenvalues and ask for all eigenvalues in this range.
  456. *> \endverbatim
  457. *>
  458. *> \param[out] WR
  459. *> \verbatim
  460. *> WR is DOUBLE PRECISION array of
  461. *> dimension( max(NN) )
  462. *> All eigenvalues of A, computed to high
  463. *> absolute accuracy, with different options.
  464. *> as computed by DSTEBZ.
  465. *> \endverbatim
  466. *>
  467. *> \param[out] U
  468. *> \verbatim
  469. *> U is DOUBLE PRECISION array of
  470. *> dimension( LDU, max(NN) ).
  471. *> The orthogonal matrix computed by DSYTRD + DORGTR.
  472. *> \endverbatim
  473. *>
  474. *> \param[in] LDU
  475. *> \verbatim
  476. *> LDU is INTEGER
  477. *> The leading dimension of U, Z, and V. It must be at least 1
  478. *> and at least max( NN ).
  479. *> \endverbatim
  480. *>
  481. *> \param[out] V
  482. *> \verbatim
  483. *> V is DOUBLE PRECISION array of
  484. *> dimension( LDU, max(NN) ).
  485. *> The Housholder vectors computed by DSYTRD in reducing A to
  486. *> tridiagonal form. The vectors computed with UPLO='U' are
  487. *> in the upper triangle, and the vectors computed with UPLO='L'
  488. *> are in the lower triangle. (As described in DSYTRD, the
  489. *> sub- and superdiagonal are not set to 1, although the
  490. *> true Householder vector has a 1 in that position. The
  491. *> routines that use V, such as DORGTR, set those entries to
  492. *> 1 before using them, and then restore them later.)
  493. *> \endverbatim
  494. *>
  495. *> \param[out] VP
  496. *> \verbatim
  497. *> VP is DOUBLE PRECISION array of
  498. *> dimension( max(NN)*max(NN+1)/2 )
  499. *> The matrix V stored in packed format.
  500. *> \endverbatim
  501. *>
  502. *> \param[out] TAU
  503. *> \verbatim
  504. *> TAU is DOUBLE PRECISION array of
  505. *> dimension( max(NN) )
  506. *> The Householder factors computed by DSYTRD in reducing A
  507. *> to tridiagonal form.
  508. *> \endverbatim
  509. *>
  510. *> \param[out] Z
  511. *> \verbatim
  512. *> Z is DOUBLE PRECISION array of
  513. *> dimension( LDU, max(NN) ).
  514. *> The orthogonal matrix of eigenvectors computed by DSTEQR,
  515. *> DPTEQR, and DSTEIN.
  516. *> \endverbatim
  517. *>
  518. *> \param[out] WORK
  519. *> \verbatim
  520. *> WORK is DOUBLE PRECISION array of
  521. *> dimension( LWORK )
  522. *> \endverbatim
  523. *>
  524. *> \param[in] LWORK
  525. *> \verbatim
  526. *> LWORK is INTEGER
  527. *> The number of entries in WORK. This must be at least
  528. *> 1 + 4 * Nmax + 2 * Nmax * lg Nmax + 3 * Nmax**2
  529. *> where Nmax = max( NN(j), 2 ) and lg = log base 2.
  530. *> \endverbatim
  531. *>
  532. *> \param[out] IWORK
  533. *> \verbatim
  534. *> IWORK is INTEGER array,
  535. *> Workspace.
  536. *> \endverbatim
  537. *>
  538. *> \param[out] LIWORK
  539. *> \verbatim
  540. *> LIWORK is INTEGER
  541. *> The number of entries in IWORK. This must be at least
  542. *> 6 + 6*Nmax + 5 * Nmax * lg Nmax
  543. *> where Nmax = max( NN(j), 2 ) and lg = log base 2.
  544. *> \endverbatim
  545. *>
  546. *> \param[out] RESULT
  547. *> \verbatim
  548. *> RESULT is DOUBLE PRECISION array, dimension (26)
  549. *> The values computed by the tests described above.
  550. *> The values are currently limited to 1/ulp, to avoid
  551. *> overflow.
  552. *> \endverbatim
  553. *>
  554. *> \param[out] INFO
  555. *> \verbatim
  556. *> INFO is INTEGER
  557. *> If 0, then everything ran OK.
  558. *> -1: NSIZES < 0
  559. *> -2: Some NN(j) < 0
  560. *> -3: NTYPES < 0
  561. *> -5: THRESH < 0
  562. *> -9: LDA < 1 or LDA < NMAX, where NMAX is max( NN(j) ).
  563. *> -23: LDU < 1 or LDU < NMAX.
  564. *> -29: LWORK too small.
  565. *> If DLATMR, SLATMS, DSYTRD, DORGTR, DSTEQR, SSTERF,
  566. *> or DORMC2 returns an error code, the
  567. *> absolute value of it is returned.
  568. *>
  569. *>-----------------------------------------------------------------------
  570. *>
  571. *> Some Local Variables and Parameters:
  572. *> ---- ----- --------- --- ----------
  573. *> ZERO, ONE Real 0 and 1.
  574. *> MAXTYP The number of types defined.
  575. *> NTEST The number of tests performed, or which can
  576. *> be performed so far, for the current matrix.
  577. *> NTESTT The total number of tests performed so far.
  578. *> NBLOCK Blocksize as returned by ENVIR.
  579. *> NMAX Largest value in NN.
  580. *> NMATS The number of matrices generated so far.
  581. *> NERRS The number of tests which have exceeded THRESH
  582. *> so far.
  583. *> COND, IMODE Values to be passed to the matrix generators.
  584. *> ANORM Norm of A; passed to matrix generators.
  585. *>
  586. *> OVFL, UNFL Overflow and underflow thresholds.
  587. *> ULP, ULPINV Finest relative precision and its inverse.
  588. *> RTOVFL, RTUNFL Square roots of the previous 2 values.
  589. *> The following four arrays decode JTYPE:
  590. *> KTYPE(j) The general type (1-10) for type "j".
  591. *> KMODE(j) The MODE value to be passed to the matrix
  592. *> generator for type "j".
  593. *> KMAGN(j) The order of magnitude ( O(1),
  594. *> O(overflow^(1/2) ), O(underflow^(1/2) )
  595. *> \endverbatim
  596. *
  597. * Authors:
  598. * ========
  599. *
  600. *> \author Univ. of Tennessee
  601. *> \author Univ. of California Berkeley
  602. *> \author Univ. of Colorado Denver
  603. *> \author NAG Ltd.
  604. *
  605. *> \ingroup double_eig
  606. *
  607. * =====================================================================
  608. SUBROUTINE DCHKST2STG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
  609. $ NOUNIT, A, LDA, AP, SD, SE, D1, D2, D3, D4, D5,
  610. $ WA1, WA2, WA3, WR, U, LDU, V, VP, TAU, Z, WORK,
  611. $ LWORK, IWORK, LIWORK, RESULT, INFO )
  612. *
  613. * -- LAPACK test routine --
  614. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  615. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  616. *
  617. * .. Scalar Arguments ..
  618. INTEGER INFO, LDA, LDU, LIWORK, LWORK, NOUNIT, NSIZES,
  619. $ NTYPES
  620. DOUBLE PRECISION THRESH
  621. * ..
  622. * .. Array Arguments ..
  623. LOGICAL DOTYPE( * )
  624. INTEGER ISEED( 4 ), IWORK( * ), NN( * )
  625. DOUBLE PRECISION A( LDA, * ), AP( * ), D1( * ), D2( * ),
  626. $ D3( * ), D4( * ), D5( * ), RESULT( * ),
  627. $ SD( * ), SE( * ), TAU( * ), U( LDU, * ),
  628. $ V( LDU, * ), VP( * ), WA1( * ), WA2( * ),
  629. $ WA3( * ), WORK( * ), WR( * ), Z( LDU, * )
  630. * ..
  631. *
  632. * =====================================================================
  633. *
  634. * .. Parameters ..
  635. DOUBLE PRECISION ZERO, ONE, TWO, EIGHT, TEN, HUN
  636. PARAMETER ( ZERO = 0.0D0, ONE = 1.0D0, TWO = 2.0D0,
  637. $ EIGHT = 8.0D0, TEN = 10.0D0, HUN = 100.0D0 )
  638. DOUBLE PRECISION HALF
  639. PARAMETER ( HALF = ONE / TWO )
  640. INTEGER MAXTYP
  641. PARAMETER ( MAXTYP = 21 )
  642. LOGICAL SRANGE
  643. PARAMETER ( SRANGE = .FALSE. )
  644. LOGICAL SREL
  645. PARAMETER ( SREL = .FALSE. )
  646. * ..
  647. * .. Local Scalars ..
  648. LOGICAL BADNN, TRYRAC
  649. INTEGER I, IINFO, IL, IMODE, ITEMP, ITYPE, IU, J, JC,
  650. $ JR, JSIZE, JTYPE, LGN, LIWEDC, LOG2UI, LWEDC,
  651. $ M, M2, M3, MTYPES, N, NAP, NBLOCK, NERRS,
  652. $ NMATS, NMAX, NSPLIT, NTEST, NTESTT, LH, LW
  653. DOUBLE PRECISION ABSTOL, ANINV, ANORM, COND, OVFL, RTOVFL,
  654. $ RTUNFL, TEMP1, TEMP2, TEMP3, TEMP4, ULP,
  655. $ ULPINV, UNFL, VL, VU
  656. * ..
  657. * .. Local Arrays ..
  658. INTEGER IDUMMA( 1 ), IOLDSD( 4 ), ISEED2( 4 ),
  659. $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
  660. $ KTYPE( MAXTYP )
  661. DOUBLE PRECISION DUMMA( 1 )
  662. * ..
  663. * .. External Functions ..
  664. INTEGER ILAENV
  665. DOUBLE PRECISION DLAMCH, DLARND, DSXT1
  666. EXTERNAL ILAENV, DLAMCH, DLARND, DSXT1
  667. * ..
  668. * .. External Subroutines ..
  669. EXTERNAL DCOPY, DLABAD, DLACPY, DLASET, DLASUM, DLATMR,
  670. $ DLATMS, DOPGTR, DORGTR, DPTEQR, DSPT21, DSPTRD,
  671. $ DSTEBZ, DSTECH, DSTEDC, DSTEMR, DSTEIN, DSTEQR,
  672. $ DSTERF, DSTT21, DSTT22, DSYT21, DSYTRD, XERBLA,
  673. $ DSYTRD_2STAGE
  674. * ..
  675. * .. Intrinsic Functions ..
  676. INTRINSIC ABS, DBLE, INT, LOG, MAX, MIN, SQRT
  677. * ..
  678. * .. Data statements ..
  679. DATA KTYPE / 1, 2, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 8,
  680. $ 8, 8, 9, 9, 9, 9, 9, 10 /
  681. DATA KMAGN / 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 2, 3, 1,
  682. $ 2, 3, 1, 1, 1, 2, 3, 1 /
  683. DATA KMODE / 0, 0, 4, 3, 1, 4, 4, 4, 3, 1, 4, 4, 0,
  684. $ 0, 0, 4, 3, 1, 4, 4, 3 /
  685. * ..
  686. * .. Executable Statements ..
  687. *
  688. * Keep ftnchek happy
  689. IDUMMA( 1 ) = 1
  690. *
  691. * Check for errors
  692. *
  693. NTESTT = 0
  694. INFO = 0
  695. *
  696. * Important constants
  697. *
  698. BADNN = .FALSE.
  699. TRYRAC = .TRUE.
  700. NMAX = 1
  701. DO 10 J = 1, NSIZES
  702. NMAX = MAX( NMAX, NN( J ) )
  703. IF( NN( J ).LT.0 )
  704. $ BADNN = .TRUE.
  705. 10 CONTINUE
  706. *
  707. NBLOCK = ILAENV( 1, 'DSYTRD', 'L', NMAX, -1, -1, -1 )
  708. NBLOCK = MIN( NMAX, MAX( 1, NBLOCK ) )
  709. *
  710. * Check for errors
  711. *
  712. IF( NSIZES.LT.0 ) THEN
  713. INFO = -1
  714. ELSE IF( BADNN ) THEN
  715. INFO = -2
  716. ELSE IF( NTYPES.LT.0 ) THEN
  717. INFO = -3
  718. ELSE IF( LDA.LT.NMAX ) THEN
  719. INFO = -9
  720. ELSE IF( LDU.LT.NMAX ) THEN
  721. INFO = -23
  722. ELSE IF( 2*MAX( 2, NMAX )**2.GT.LWORK ) THEN
  723. INFO = -29
  724. END IF
  725. *
  726. IF( INFO.NE.0 ) THEN
  727. CALL XERBLA( 'DCHKST2STG', -INFO )
  728. RETURN
  729. END IF
  730. *
  731. * Quick return if possible
  732. *
  733. IF( NSIZES.EQ.0 .OR. NTYPES.EQ.0 )
  734. $ RETURN
  735. *
  736. * More Important constants
  737. *
  738. UNFL = DLAMCH( 'Safe minimum' )
  739. OVFL = ONE / UNFL
  740. CALL DLABAD( UNFL, OVFL )
  741. ULP = DLAMCH( 'Epsilon' )*DLAMCH( 'Base' )
  742. ULPINV = ONE / ULP
  743. LOG2UI = INT( LOG( ULPINV ) / LOG( TWO ) )
  744. RTUNFL = SQRT( UNFL )
  745. RTOVFL = SQRT( OVFL )
  746. *
  747. * Loop over sizes, types
  748. *
  749. DO 20 I = 1, 4
  750. ISEED2( I ) = ISEED( I )
  751. 20 CONTINUE
  752. NERRS = 0
  753. NMATS = 0
  754. *
  755. DO 310 JSIZE = 1, NSIZES
  756. N = NN( JSIZE )
  757. IF( N.GT.0 ) THEN
  758. LGN = INT( LOG( DBLE( N ) ) / LOG( TWO ) )
  759. IF( 2**LGN.LT.N )
  760. $ LGN = LGN + 1
  761. IF( 2**LGN.LT.N )
  762. $ LGN = LGN + 1
  763. LWEDC = 1 + 4*N + 2*N*LGN + 4*N**2
  764. LIWEDC = 6 + 6*N + 5*N*LGN
  765. ELSE
  766. LWEDC = 8
  767. LIWEDC = 12
  768. END IF
  769. NAP = ( N*( N+1 ) ) / 2
  770. ANINV = ONE / DBLE( MAX( 1, N ) )
  771. *
  772. IF( NSIZES.NE.1 ) THEN
  773. MTYPES = MIN( MAXTYP, NTYPES )
  774. ELSE
  775. MTYPES = MIN( MAXTYP+1, NTYPES )
  776. END IF
  777. *
  778. DO 300 JTYPE = 1, MTYPES
  779. IF( .NOT.DOTYPE( JTYPE ) )
  780. $ GO TO 300
  781. NMATS = NMATS + 1
  782. NTEST = 0
  783. *
  784. DO 30 J = 1, 4
  785. IOLDSD( J ) = ISEED( J )
  786. 30 CONTINUE
  787. *
  788. * Compute "A"
  789. *
  790. * Control parameters:
  791. *
  792. * KMAGN KMODE KTYPE
  793. * =1 O(1) clustered 1 zero
  794. * =2 large clustered 2 identity
  795. * =3 small exponential (none)
  796. * =4 arithmetic diagonal, (w/ eigenvalues)
  797. * =5 random log symmetric, w/ eigenvalues
  798. * =6 random (none)
  799. * =7 random diagonal
  800. * =8 random symmetric
  801. * =9 positive definite
  802. * =10 diagonally dominant tridiagonal
  803. *
  804. IF( MTYPES.GT.MAXTYP )
  805. $ GO TO 100
  806. *
  807. ITYPE = KTYPE( JTYPE )
  808. IMODE = KMODE( JTYPE )
  809. *
  810. * Compute norm
  811. *
  812. GO TO ( 40, 50, 60 )KMAGN( JTYPE )
  813. *
  814. 40 CONTINUE
  815. ANORM = ONE
  816. GO TO 70
  817. *
  818. 50 CONTINUE
  819. ANORM = ( RTOVFL*ULP )*ANINV
  820. GO TO 70
  821. *
  822. 60 CONTINUE
  823. ANORM = RTUNFL*N*ULPINV
  824. GO TO 70
  825. *
  826. 70 CONTINUE
  827. *
  828. CALL DLASET( 'Full', LDA, N, ZERO, ZERO, A, LDA )
  829. IINFO = 0
  830. IF( JTYPE.LE.15 ) THEN
  831. COND = ULPINV
  832. ELSE
  833. COND = ULPINV*ANINV / TEN
  834. END IF
  835. *
  836. * Special Matrices -- Identity & Jordan block
  837. *
  838. * Zero
  839. *
  840. IF( ITYPE.EQ.1 ) THEN
  841. IINFO = 0
  842. *
  843. ELSE IF( ITYPE.EQ.2 ) THEN
  844. *
  845. * Identity
  846. *
  847. DO 80 JC = 1, N
  848. A( JC, JC ) = ANORM
  849. 80 CONTINUE
  850. *
  851. ELSE IF( ITYPE.EQ.4 ) THEN
  852. *
  853. * Diagonal Matrix, [Eigen]values Specified
  854. *
  855. CALL DLATMS( N, N, 'S', ISEED, 'S', WORK, IMODE, COND,
  856. $ ANORM, 0, 0, 'N', A, LDA, WORK( N+1 ),
  857. $ IINFO )
  858. *
  859. *
  860. ELSE IF( ITYPE.EQ.5 ) THEN
  861. *
  862. * Symmetric, eigenvalues specified
  863. *
  864. CALL DLATMS( N, N, 'S', ISEED, 'S', WORK, IMODE, COND,
  865. $ ANORM, N, N, 'N', A, LDA, WORK( N+1 ),
  866. $ IINFO )
  867. *
  868. ELSE IF( ITYPE.EQ.7 ) THEN
  869. *
  870. * Diagonal, random eigenvalues
  871. *
  872. CALL DLATMR( N, N, 'S', ISEED, 'S', WORK, 6, ONE, ONE,
  873. $ 'T', 'N', WORK( N+1 ), 1, ONE,
  874. $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, 0, 0,
  875. $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
  876. *
  877. ELSE IF( ITYPE.EQ.8 ) THEN
  878. *
  879. * Symmetric, random eigenvalues
  880. *
  881. CALL DLATMR( N, N, 'S', ISEED, 'S', WORK, 6, ONE, ONE,
  882. $ 'T', 'N', WORK( N+1 ), 1, ONE,
  883. $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, N,
  884. $ ZERO, ANORM, 'NO', A, LDA, IWORK, IINFO )
  885. *
  886. ELSE IF( ITYPE.EQ.9 ) THEN
  887. *
  888. * Positive definite, eigenvalues specified.
  889. *
  890. CALL DLATMS( N, N, 'S', ISEED, 'P', WORK, IMODE, COND,
  891. $ ANORM, N, N, 'N', A, LDA, WORK( N+1 ),
  892. $ IINFO )
  893. *
  894. ELSE IF( ITYPE.EQ.10 ) THEN
  895. *
  896. * Positive definite tridiagonal, eigenvalues specified.
  897. *
  898. CALL DLATMS( N, N, 'S', ISEED, 'P', WORK, IMODE, COND,
  899. $ ANORM, 1, 1, 'N', A, LDA, WORK( N+1 ),
  900. $ IINFO )
  901. DO 90 I = 2, N
  902. TEMP1 = ABS( A( I-1, I ) ) /
  903. $ SQRT( ABS( A( I-1, I-1 )*A( I, I ) ) )
  904. IF( TEMP1.GT.HALF ) THEN
  905. A( I-1, I ) = HALF*SQRT( ABS( A( I-1, I-1 )*A( I,
  906. $ I ) ) )
  907. A( I, I-1 ) = A( I-1, I )
  908. END IF
  909. 90 CONTINUE
  910. *
  911. ELSE
  912. *
  913. IINFO = 1
  914. END IF
  915. *
  916. IF( IINFO.NE.0 ) THEN
  917. WRITE( NOUNIT, FMT = 9999 )'Generator', IINFO, N, JTYPE,
  918. $ IOLDSD
  919. INFO = ABS( IINFO )
  920. RETURN
  921. END IF
  922. *
  923. 100 CONTINUE
  924. *
  925. * Call DSYTRD and DORGTR to compute S and U from
  926. * upper triangle.
  927. *
  928. CALL DLACPY( 'U', N, N, A, LDA, V, LDU )
  929. *
  930. NTEST = 1
  931. CALL DSYTRD( 'U', N, V, LDU, SD, SE, TAU, WORK, LWORK,
  932. $ IINFO )
  933. *
  934. IF( IINFO.NE.0 ) THEN
  935. WRITE( NOUNIT, FMT = 9999 )'DSYTRD(U)', IINFO, N, JTYPE,
  936. $ IOLDSD
  937. INFO = ABS( IINFO )
  938. IF( IINFO.LT.0 ) THEN
  939. RETURN
  940. ELSE
  941. RESULT( 1 ) = ULPINV
  942. GO TO 280
  943. END IF
  944. END IF
  945. *
  946. CALL DLACPY( 'U', N, N, V, LDU, U, LDU )
  947. *
  948. NTEST = 2
  949. CALL DORGTR( 'U', N, U, LDU, TAU, WORK, LWORK, IINFO )
  950. IF( IINFO.NE.0 ) THEN
  951. WRITE( NOUNIT, FMT = 9999 )'DORGTR(U)', IINFO, N, JTYPE,
  952. $ IOLDSD
  953. INFO = ABS( IINFO )
  954. IF( IINFO.LT.0 ) THEN
  955. RETURN
  956. ELSE
  957. RESULT( 2 ) = ULPINV
  958. GO TO 280
  959. END IF
  960. END IF
  961. *
  962. * Do tests 1 and 2
  963. *
  964. CALL DSYT21( 2, 'Upper', N, 1, A, LDA, SD, SE, U, LDU, V,
  965. $ LDU, TAU, WORK, RESULT( 1 ) )
  966. CALL DSYT21( 3, 'Upper', N, 1, A, LDA, SD, SE, U, LDU, V,
  967. $ LDU, TAU, WORK, RESULT( 2 ) )
  968. *
  969. * Compute D1 the eigenvalues resulting from the tridiagonal
  970. * form using the standard 1-stage algorithm and use it as a
  971. * reference to compare with the 2-stage technique
  972. *
  973. * Compute D1 from the 1-stage and used as reference for the
  974. * 2-stage
  975. *
  976. CALL DCOPY( N, SD, 1, D1, 1 )
  977. IF( N.GT.0 )
  978. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  979. *
  980. CALL DSTEQR( 'N', N, D1, WORK, WORK( N+1 ), LDU,
  981. $ WORK( N+1 ), IINFO )
  982. IF( IINFO.NE.0 ) THEN
  983. WRITE( NOUNIT, FMT = 9999 )'DSTEQR(N)', IINFO, N, JTYPE,
  984. $ IOLDSD
  985. INFO = ABS( IINFO )
  986. IF( IINFO.LT.0 ) THEN
  987. RETURN
  988. ELSE
  989. RESULT( 3 ) = ULPINV
  990. GO TO 280
  991. END IF
  992. END IF
  993. *
  994. * 2-STAGE TRD Upper case is used to compute D2.
  995. * Note to set SD and SE to zero to be sure not reusing
  996. * the one from above. Compare it with D1 computed
  997. * using the 1-stage.
  998. *
  999. CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N )
  1000. CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N )
  1001. CALL DLACPY( "U", N, N, A, LDA, V, LDU )
  1002. LH = MAX(1, 4*N)
  1003. LW = LWORK - LH
  1004. CALL DSYTRD_2STAGE( 'N', "U", N, V, LDU, SD, SE, TAU,
  1005. $ WORK, LH, WORK( LH+1 ), LW, IINFO )
  1006. *
  1007. * Compute D2 from the 2-stage Upper case
  1008. *
  1009. CALL DCOPY( N, SD, 1, D2, 1 )
  1010. IF( N.GT.0 )
  1011. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1012. *
  1013. CALL DSTEQR( 'N', N, D2, WORK, WORK( N+1 ), LDU,
  1014. $ WORK( N+1 ), IINFO )
  1015. IF( IINFO.NE.0 ) THEN
  1016. WRITE( NOUNIT, FMT = 9999 )'DSTEQR(N)', IINFO, N, JTYPE,
  1017. $ IOLDSD
  1018. INFO = ABS( IINFO )
  1019. IF( IINFO.LT.0 ) THEN
  1020. RETURN
  1021. ELSE
  1022. RESULT( 3 ) = ULPINV
  1023. GO TO 280
  1024. END IF
  1025. END IF
  1026. *
  1027. * 2-STAGE TRD Lower case is used to compute D3.
  1028. * Note to set SD and SE to zero to be sure not reusing
  1029. * the one from above. Compare it with D1 computed
  1030. * using the 1-stage.
  1031. *
  1032. CALL DLASET( 'Full', N, 1, ZERO, ZERO, SD, N )
  1033. CALL DLASET( 'Full', N, 1, ZERO, ZERO, SE, N )
  1034. CALL DLACPY( "L", N, N, A, LDA, V, LDU )
  1035. CALL DSYTRD_2STAGE( 'N', "L", N, V, LDU, SD, SE, TAU,
  1036. $ WORK, LH, WORK( LH+1 ), LW, IINFO )
  1037. *
  1038. * Compute D3 from the 2-stage Upper case
  1039. *
  1040. CALL DCOPY( N, SD, 1, D3, 1 )
  1041. IF( N.GT.0 )
  1042. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1043. *
  1044. CALL DSTEQR( 'N', N, D3, WORK, WORK( N+1 ), LDU,
  1045. $ WORK( N+1 ), IINFO )
  1046. IF( IINFO.NE.0 ) THEN
  1047. WRITE( NOUNIT, FMT = 9999 )'DSTEQR(N)', IINFO, N, JTYPE,
  1048. $ IOLDSD
  1049. INFO = ABS( IINFO )
  1050. IF( IINFO.LT.0 ) THEN
  1051. RETURN
  1052. ELSE
  1053. RESULT( 4 ) = ULPINV
  1054. GO TO 280
  1055. END IF
  1056. END IF
  1057. *
  1058. * Do Tests 3 and 4 which are similar to 11 and 12 but with the
  1059. * D1 computed using the standard 1-stage reduction as reference
  1060. *
  1061. NTEST = 4
  1062. TEMP1 = ZERO
  1063. TEMP2 = ZERO
  1064. TEMP3 = ZERO
  1065. TEMP4 = ZERO
  1066. *
  1067. DO 151 J = 1, N
  1068. TEMP1 = MAX( TEMP1, ABS( D1( J ) ), ABS( D2( J ) ) )
  1069. TEMP2 = MAX( TEMP2, ABS( D1( J )-D2( J ) ) )
  1070. TEMP3 = MAX( TEMP3, ABS( D1( J ) ), ABS( D3( J ) ) )
  1071. TEMP4 = MAX( TEMP4, ABS( D1( J )-D3( J ) ) )
  1072. 151 CONTINUE
  1073. *
  1074. RESULT( 3 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) )
  1075. RESULT( 4 ) = TEMP4 / MAX( UNFL, ULP*MAX( TEMP3, TEMP4 ) )
  1076. *
  1077. * Store the upper triangle of A in AP
  1078. *
  1079. I = 0
  1080. DO 120 JC = 1, N
  1081. DO 110 JR = 1, JC
  1082. I = I + 1
  1083. AP( I ) = A( JR, JC )
  1084. 110 CONTINUE
  1085. 120 CONTINUE
  1086. *
  1087. * Call DSPTRD and DOPGTR to compute S and U from AP
  1088. *
  1089. CALL DCOPY( NAP, AP, 1, VP, 1 )
  1090. *
  1091. NTEST = 5
  1092. CALL DSPTRD( 'U', N, VP, SD, SE, TAU, IINFO )
  1093. *
  1094. IF( IINFO.NE.0 ) THEN
  1095. WRITE( NOUNIT, FMT = 9999 )'DSPTRD(U)', IINFO, N, JTYPE,
  1096. $ IOLDSD
  1097. INFO = ABS( IINFO )
  1098. IF( IINFO.LT.0 ) THEN
  1099. RETURN
  1100. ELSE
  1101. RESULT( 5 ) = ULPINV
  1102. GO TO 280
  1103. END IF
  1104. END IF
  1105. *
  1106. NTEST = 6
  1107. CALL DOPGTR( 'U', N, VP, TAU, U, LDU, WORK, IINFO )
  1108. IF( IINFO.NE.0 ) THEN
  1109. WRITE( NOUNIT, FMT = 9999 )'DOPGTR(U)', IINFO, N, JTYPE,
  1110. $ IOLDSD
  1111. INFO = ABS( IINFO )
  1112. IF( IINFO.LT.0 ) THEN
  1113. RETURN
  1114. ELSE
  1115. RESULT( 6 ) = ULPINV
  1116. GO TO 280
  1117. END IF
  1118. END IF
  1119. *
  1120. * Do tests 5 and 6
  1121. *
  1122. CALL DSPT21( 2, 'Upper', N, 1, AP, SD, SE, U, LDU, VP, TAU,
  1123. $ WORK, RESULT( 5 ) )
  1124. CALL DSPT21( 3, 'Upper', N, 1, AP, SD, SE, U, LDU, VP, TAU,
  1125. $ WORK, RESULT( 6 ) )
  1126. *
  1127. * Store the lower triangle of A in AP
  1128. *
  1129. I = 0
  1130. DO 140 JC = 1, N
  1131. DO 130 JR = JC, N
  1132. I = I + 1
  1133. AP( I ) = A( JR, JC )
  1134. 130 CONTINUE
  1135. 140 CONTINUE
  1136. *
  1137. * Call DSPTRD and DOPGTR to compute S and U from AP
  1138. *
  1139. CALL DCOPY( NAP, AP, 1, VP, 1 )
  1140. *
  1141. NTEST = 7
  1142. CALL DSPTRD( 'L', N, VP, SD, SE, TAU, IINFO )
  1143. *
  1144. IF( IINFO.NE.0 ) THEN
  1145. WRITE( NOUNIT, FMT = 9999 )'DSPTRD(L)', IINFO, N, JTYPE,
  1146. $ IOLDSD
  1147. INFO = ABS( IINFO )
  1148. IF( IINFO.LT.0 ) THEN
  1149. RETURN
  1150. ELSE
  1151. RESULT( 7 ) = ULPINV
  1152. GO TO 280
  1153. END IF
  1154. END IF
  1155. *
  1156. NTEST = 8
  1157. CALL DOPGTR( 'L', N, VP, TAU, U, LDU, WORK, IINFO )
  1158. IF( IINFO.NE.0 ) THEN
  1159. WRITE( NOUNIT, FMT = 9999 )'DOPGTR(L)', IINFO, N, JTYPE,
  1160. $ IOLDSD
  1161. INFO = ABS( IINFO )
  1162. IF( IINFO.LT.0 ) THEN
  1163. RETURN
  1164. ELSE
  1165. RESULT( 8 ) = ULPINV
  1166. GO TO 280
  1167. END IF
  1168. END IF
  1169. *
  1170. CALL DSPT21( 2, 'Lower', N, 1, AP, SD, SE, U, LDU, VP, TAU,
  1171. $ WORK, RESULT( 7 ) )
  1172. CALL DSPT21( 3, 'Lower', N, 1, AP, SD, SE, U, LDU, VP, TAU,
  1173. $ WORK, RESULT( 8 ) )
  1174. *
  1175. * Call DSTEQR to compute D1, D2, and Z, do tests.
  1176. *
  1177. * Compute D1 and Z
  1178. *
  1179. CALL DCOPY( N, SD, 1, D1, 1 )
  1180. IF( N.GT.0 )
  1181. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1182. CALL DLASET( 'Full', N, N, ZERO, ONE, Z, LDU )
  1183. *
  1184. NTEST = 9
  1185. CALL DSTEQR( 'V', N, D1, WORK, Z, LDU, WORK( N+1 ), IINFO )
  1186. IF( IINFO.NE.0 ) THEN
  1187. WRITE( NOUNIT, FMT = 9999 )'DSTEQR(V)', IINFO, N, JTYPE,
  1188. $ IOLDSD
  1189. INFO = ABS( IINFO )
  1190. IF( IINFO.LT.0 ) THEN
  1191. RETURN
  1192. ELSE
  1193. RESULT( 9 ) = ULPINV
  1194. GO TO 280
  1195. END IF
  1196. END IF
  1197. *
  1198. * Compute D2
  1199. *
  1200. CALL DCOPY( N, SD, 1, D2, 1 )
  1201. IF( N.GT.0 )
  1202. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1203. *
  1204. NTEST = 11
  1205. CALL DSTEQR( 'N', N, D2, WORK, WORK( N+1 ), LDU,
  1206. $ WORK( N+1 ), IINFO )
  1207. IF( IINFO.NE.0 ) THEN
  1208. WRITE( NOUNIT, FMT = 9999 )'DSTEQR(N)', IINFO, N, JTYPE,
  1209. $ IOLDSD
  1210. INFO = ABS( IINFO )
  1211. IF( IINFO.LT.0 ) THEN
  1212. RETURN
  1213. ELSE
  1214. RESULT( 11 ) = ULPINV
  1215. GO TO 280
  1216. END IF
  1217. END IF
  1218. *
  1219. * Compute D3 (using PWK method)
  1220. *
  1221. CALL DCOPY( N, SD, 1, D3, 1 )
  1222. IF( N.GT.0 )
  1223. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1224. *
  1225. NTEST = 12
  1226. CALL DSTERF( N, D3, WORK, IINFO )
  1227. IF( IINFO.NE.0 ) THEN
  1228. WRITE( NOUNIT, FMT = 9999 )'DSTERF', IINFO, N, JTYPE,
  1229. $ IOLDSD
  1230. INFO = ABS( IINFO )
  1231. IF( IINFO.LT.0 ) THEN
  1232. RETURN
  1233. ELSE
  1234. RESULT( 12 ) = ULPINV
  1235. GO TO 280
  1236. END IF
  1237. END IF
  1238. *
  1239. * Do Tests 9 and 10
  1240. *
  1241. CALL DSTT21( N, 0, SD, SE, D1, DUMMA, Z, LDU, WORK,
  1242. $ RESULT( 9 ) )
  1243. *
  1244. * Do Tests 11 and 12
  1245. *
  1246. TEMP1 = ZERO
  1247. TEMP2 = ZERO
  1248. TEMP3 = ZERO
  1249. TEMP4 = ZERO
  1250. *
  1251. DO 150 J = 1, N
  1252. TEMP1 = MAX( TEMP1, ABS( D1( J ) ), ABS( D2( J ) ) )
  1253. TEMP2 = MAX( TEMP2, ABS( D1( J )-D2( J ) ) )
  1254. TEMP3 = MAX( TEMP3, ABS( D1( J ) ), ABS( D3( J ) ) )
  1255. TEMP4 = MAX( TEMP4, ABS( D1( J )-D3( J ) ) )
  1256. 150 CONTINUE
  1257. *
  1258. RESULT( 11 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) )
  1259. RESULT( 12 ) = TEMP4 / MAX( UNFL, ULP*MAX( TEMP3, TEMP4 ) )
  1260. *
  1261. * Do Test 13 -- Sturm Sequence Test of Eigenvalues
  1262. * Go up by factors of two until it succeeds
  1263. *
  1264. NTEST = 13
  1265. TEMP1 = THRESH*( HALF-ULP )
  1266. *
  1267. DO 160 J = 0, LOG2UI
  1268. CALL DSTECH( N, SD, SE, D1, TEMP1, WORK, IINFO )
  1269. IF( IINFO.EQ.0 )
  1270. $ GO TO 170
  1271. TEMP1 = TEMP1*TWO
  1272. 160 CONTINUE
  1273. *
  1274. 170 CONTINUE
  1275. RESULT( 13 ) = TEMP1
  1276. *
  1277. * For positive definite matrices ( JTYPE.GT.15 ) call DPTEQR
  1278. * and do tests 14, 15, and 16 .
  1279. *
  1280. IF( JTYPE.GT.15 ) THEN
  1281. *
  1282. * Compute D4 and Z4
  1283. *
  1284. CALL DCOPY( N, SD, 1, D4, 1 )
  1285. IF( N.GT.0 )
  1286. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1287. CALL DLASET( 'Full', N, N, ZERO, ONE, Z, LDU )
  1288. *
  1289. NTEST = 14
  1290. CALL DPTEQR( 'V', N, D4, WORK, Z, LDU, WORK( N+1 ),
  1291. $ IINFO )
  1292. IF( IINFO.NE.0 ) THEN
  1293. WRITE( NOUNIT, FMT = 9999 )'DPTEQR(V)', IINFO, N,
  1294. $ JTYPE, IOLDSD
  1295. INFO = ABS( IINFO )
  1296. IF( IINFO.LT.0 ) THEN
  1297. RETURN
  1298. ELSE
  1299. RESULT( 14 ) = ULPINV
  1300. GO TO 280
  1301. END IF
  1302. END IF
  1303. *
  1304. * Do Tests 14 and 15
  1305. *
  1306. CALL DSTT21( N, 0, SD, SE, D4, DUMMA, Z, LDU, WORK,
  1307. $ RESULT( 14 ) )
  1308. *
  1309. * Compute D5
  1310. *
  1311. CALL DCOPY( N, SD, 1, D5, 1 )
  1312. IF( N.GT.0 )
  1313. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1314. *
  1315. NTEST = 16
  1316. CALL DPTEQR( 'N', N, D5, WORK, Z, LDU, WORK( N+1 ),
  1317. $ IINFO )
  1318. IF( IINFO.NE.0 ) THEN
  1319. WRITE( NOUNIT, FMT = 9999 )'DPTEQR(N)', IINFO, N,
  1320. $ JTYPE, IOLDSD
  1321. INFO = ABS( IINFO )
  1322. IF( IINFO.LT.0 ) THEN
  1323. RETURN
  1324. ELSE
  1325. RESULT( 16 ) = ULPINV
  1326. GO TO 280
  1327. END IF
  1328. END IF
  1329. *
  1330. * Do Test 16
  1331. *
  1332. TEMP1 = ZERO
  1333. TEMP2 = ZERO
  1334. DO 180 J = 1, N
  1335. TEMP1 = MAX( TEMP1, ABS( D4( J ) ), ABS( D5( J ) ) )
  1336. TEMP2 = MAX( TEMP2, ABS( D4( J )-D5( J ) ) )
  1337. 180 CONTINUE
  1338. *
  1339. RESULT( 16 ) = TEMP2 / MAX( UNFL,
  1340. $ HUN*ULP*MAX( TEMP1, TEMP2 ) )
  1341. ELSE
  1342. RESULT( 14 ) = ZERO
  1343. RESULT( 15 ) = ZERO
  1344. RESULT( 16 ) = ZERO
  1345. END IF
  1346. *
  1347. * Call DSTEBZ with different options and do tests 17-18.
  1348. *
  1349. * If S is positive definite and diagonally dominant,
  1350. * ask for all eigenvalues with high relative accuracy.
  1351. *
  1352. VL = ZERO
  1353. VU = ZERO
  1354. IL = 0
  1355. IU = 0
  1356. IF( JTYPE.EQ.21 ) THEN
  1357. NTEST = 17
  1358. ABSTOL = UNFL + UNFL
  1359. CALL DSTEBZ( 'A', 'E', N, VL, VU, IL, IU, ABSTOL, SD, SE,
  1360. $ M, NSPLIT, WR, IWORK( 1 ), IWORK( N+1 ),
  1361. $ WORK, IWORK( 2*N+1 ), IINFO )
  1362. IF( IINFO.NE.0 ) THEN
  1363. WRITE( NOUNIT, FMT = 9999 )'DSTEBZ(A,rel)', IINFO, N,
  1364. $ JTYPE, IOLDSD
  1365. INFO = ABS( IINFO )
  1366. IF( IINFO.LT.0 ) THEN
  1367. RETURN
  1368. ELSE
  1369. RESULT( 17 ) = ULPINV
  1370. GO TO 280
  1371. END IF
  1372. END IF
  1373. *
  1374. * Do test 17
  1375. *
  1376. TEMP2 = TWO*( TWO*N-ONE )*ULP*( ONE+EIGHT*HALF**2 ) /
  1377. $ ( ONE-HALF )**4
  1378. *
  1379. TEMP1 = ZERO
  1380. DO 190 J = 1, N
  1381. TEMP1 = MAX( TEMP1, ABS( D4( J )-WR( N-J+1 ) ) /
  1382. $ ( ABSTOL+ABS( D4( J ) ) ) )
  1383. 190 CONTINUE
  1384. *
  1385. RESULT( 17 ) = TEMP1 / TEMP2
  1386. ELSE
  1387. RESULT( 17 ) = ZERO
  1388. END IF
  1389. *
  1390. * Now ask for all eigenvalues with high absolute accuracy.
  1391. *
  1392. NTEST = 18
  1393. ABSTOL = UNFL + UNFL
  1394. CALL DSTEBZ( 'A', 'E', N, VL, VU, IL, IU, ABSTOL, SD, SE, M,
  1395. $ NSPLIT, WA1, IWORK( 1 ), IWORK( N+1 ), WORK,
  1396. $ IWORK( 2*N+1 ), IINFO )
  1397. IF( IINFO.NE.0 ) THEN
  1398. WRITE( NOUNIT, FMT = 9999 )'DSTEBZ(A)', IINFO, N, JTYPE,
  1399. $ IOLDSD
  1400. INFO = ABS( IINFO )
  1401. IF( IINFO.LT.0 ) THEN
  1402. RETURN
  1403. ELSE
  1404. RESULT( 18 ) = ULPINV
  1405. GO TO 280
  1406. END IF
  1407. END IF
  1408. *
  1409. * Do test 18
  1410. *
  1411. TEMP1 = ZERO
  1412. TEMP2 = ZERO
  1413. DO 200 J = 1, N
  1414. TEMP1 = MAX( TEMP1, ABS( D3( J ) ), ABS( WA1( J ) ) )
  1415. TEMP2 = MAX( TEMP2, ABS( D3( J )-WA1( J ) ) )
  1416. 200 CONTINUE
  1417. *
  1418. RESULT( 18 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) )
  1419. *
  1420. * Choose random values for IL and IU, and ask for the
  1421. * IL-th through IU-th eigenvalues.
  1422. *
  1423. NTEST = 19
  1424. IF( N.LE.1 ) THEN
  1425. IL = 1
  1426. IU = N
  1427. ELSE
  1428. IL = 1 + ( N-1 )*INT( DLARND( 1, ISEED2 ) )
  1429. IU = 1 + ( N-1 )*INT( DLARND( 1, ISEED2 ) )
  1430. IF( IU.LT.IL ) THEN
  1431. ITEMP = IU
  1432. IU = IL
  1433. IL = ITEMP
  1434. END IF
  1435. END IF
  1436. *
  1437. CALL DSTEBZ( 'I', 'E', N, VL, VU, IL, IU, ABSTOL, SD, SE,
  1438. $ M2, NSPLIT, WA2, IWORK( 1 ), IWORK( N+1 ),
  1439. $ WORK, IWORK( 2*N+1 ), IINFO )
  1440. IF( IINFO.NE.0 ) THEN
  1441. WRITE( NOUNIT, FMT = 9999 )'DSTEBZ(I)', IINFO, N, JTYPE,
  1442. $ IOLDSD
  1443. INFO = ABS( IINFO )
  1444. IF( IINFO.LT.0 ) THEN
  1445. RETURN
  1446. ELSE
  1447. RESULT( 19 ) = ULPINV
  1448. GO TO 280
  1449. END IF
  1450. END IF
  1451. *
  1452. * Determine the values VL and VU of the IL-th and IU-th
  1453. * eigenvalues and ask for all eigenvalues in this range.
  1454. *
  1455. IF( N.GT.0 ) THEN
  1456. IF( IL.NE.1 ) THEN
  1457. VL = WA1( IL ) - MAX( HALF*( WA1( IL )-WA1( IL-1 ) ),
  1458. $ ULP*ANORM, TWO*RTUNFL )
  1459. ELSE
  1460. VL = WA1( 1 ) - MAX( HALF*( WA1( N )-WA1( 1 ) ),
  1461. $ ULP*ANORM, TWO*RTUNFL )
  1462. END IF
  1463. IF( IU.NE.N ) THEN
  1464. VU = WA1( IU ) + MAX( HALF*( WA1( IU+1 )-WA1( IU ) ),
  1465. $ ULP*ANORM, TWO*RTUNFL )
  1466. ELSE
  1467. VU = WA1( N ) + MAX( HALF*( WA1( N )-WA1( 1 ) ),
  1468. $ ULP*ANORM, TWO*RTUNFL )
  1469. END IF
  1470. ELSE
  1471. VL = ZERO
  1472. VU = ONE
  1473. END IF
  1474. *
  1475. CALL DSTEBZ( 'V', 'E', N, VL, VU, IL, IU, ABSTOL, SD, SE,
  1476. $ M3, NSPLIT, WA3, IWORK( 1 ), IWORK( N+1 ),
  1477. $ WORK, IWORK( 2*N+1 ), IINFO )
  1478. IF( IINFO.NE.0 ) THEN
  1479. WRITE( NOUNIT, FMT = 9999 )'DSTEBZ(V)', IINFO, N, JTYPE,
  1480. $ IOLDSD
  1481. INFO = ABS( IINFO )
  1482. IF( IINFO.LT.0 ) THEN
  1483. RETURN
  1484. ELSE
  1485. RESULT( 19 ) = ULPINV
  1486. GO TO 280
  1487. END IF
  1488. END IF
  1489. *
  1490. IF( M3.EQ.0 .AND. N.NE.0 ) THEN
  1491. RESULT( 19 ) = ULPINV
  1492. GO TO 280
  1493. END IF
  1494. *
  1495. * Do test 19
  1496. *
  1497. TEMP1 = DSXT1( 1, WA2, M2, WA3, M3, ABSTOL, ULP, UNFL )
  1498. TEMP2 = DSXT1( 1, WA3, M3, WA2, M2, ABSTOL, ULP, UNFL )
  1499. IF( N.GT.0 ) THEN
  1500. TEMP3 = MAX( ABS( WA1( N ) ), ABS( WA1( 1 ) ) )
  1501. ELSE
  1502. TEMP3 = ZERO
  1503. END IF
  1504. *
  1505. RESULT( 19 ) = ( TEMP1+TEMP2 ) / MAX( UNFL, TEMP3*ULP )
  1506. *
  1507. * Call DSTEIN to compute eigenvectors corresponding to
  1508. * eigenvalues in WA1. (First call DSTEBZ again, to make sure
  1509. * it returns these eigenvalues in the correct order.)
  1510. *
  1511. NTEST = 21
  1512. CALL DSTEBZ( 'A', 'B', N, VL, VU, IL, IU, ABSTOL, SD, SE, M,
  1513. $ NSPLIT, WA1, IWORK( 1 ), IWORK( N+1 ), WORK,
  1514. $ IWORK( 2*N+1 ), IINFO )
  1515. IF( IINFO.NE.0 ) THEN
  1516. WRITE( NOUNIT, FMT = 9999 )'DSTEBZ(A,B)', IINFO, N,
  1517. $ JTYPE, IOLDSD
  1518. INFO = ABS( IINFO )
  1519. IF( IINFO.LT.0 ) THEN
  1520. RETURN
  1521. ELSE
  1522. RESULT( 20 ) = ULPINV
  1523. RESULT( 21 ) = ULPINV
  1524. GO TO 280
  1525. END IF
  1526. END IF
  1527. *
  1528. CALL DSTEIN( N, SD, SE, M, WA1, IWORK( 1 ), IWORK( N+1 ), Z,
  1529. $ LDU, WORK, IWORK( 2*N+1 ), IWORK( 3*N+1 ),
  1530. $ IINFO )
  1531. IF( IINFO.NE.0 ) THEN
  1532. WRITE( NOUNIT, FMT = 9999 )'DSTEIN', IINFO, N, JTYPE,
  1533. $ IOLDSD
  1534. INFO = ABS( IINFO )
  1535. IF( IINFO.LT.0 ) THEN
  1536. RETURN
  1537. ELSE
  1538. RESULT( 20 ) = ULPINV
  1539. RESULT( 21 ) = ULPINV
  1540. GO TO 280
  1541. END IF
  1542. END IF
  1543. *
  1544. * Do tests 20 and 21
  1545. *
  1546. CALL DSTT21( N, 0, SD, SE, WA1, DUMMA, Z, LDU, WORK,
  1547. $ RESULT( 20 ) )
  1548. *
  1549. * Call DSTEDC(I) to compute D1 and Z, do tests.
  1550. *
  1551. * Compute D1 and Z
  1552. *
  1553. CALL DCOPY( N, SD, 1, D1, 1 )
  1554. IF( N.GT.0 )
  1555. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1556. CALL DLASET( 'Full', N, N, ZERO, ONE, Z, LDU )
  1557. *
  1558. NTEST = 22
  1559. CALL DSTEDC( 'I', N, D1, WORK, Z, LDU, WORK( N+1 ), LWEDC-N,
  1560. $ IWORK, LIWEDC, IINFO )
  1561. IF( IINFO.NE.0 ) THEN
  1562. WRITE( NOUNIT, FMT = 9999 )'DSTEDC(I)', IINFO, N, JTYPE,
  1563. $ IOLDSD
  1564. INFO = ABS( IINFO )
  1565. IF( IINFO.LT.0 ) THEN
  1566. RETURN
  1567. ELSE
  1568. RESULT( 22 ) = ULPINV
  1569. GO TO 280
  1570. END IF
  1571. END IF
  1572. *
  1573. * Do Tests 22 and 23
  1574. *
  1575. CALL DSTT21( N, 0, SD, SE, D1, DUMMA, Z, LDU, WORK,
  1576. $ RESULT( 22 ) )
  1577. *
  1578. * Call DSTEDC(V) to compute D1 and Z, do tests.
  1579. *
  1580. * Compute D1 and Z
  1581. *
  1582. CALL DCOPY( N, SD, 1, D1, 1 )
  1583. IF( N.GT.0 )
  1584. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1585. CALL DLASET( 'Full', N, N, ZERO, ONE, Z, LDU )
  1586. *
  1587. NTEST = 24
  1588. CALL DSTEDC( 'V', N, D1, WORK, Z, LDU, WORK( N+1 ), LWEDC-N,
  1589. $ IWORK, LIWEDC, IINFO )
  1590. IF( IINFO.NE.0 ) THEN
  1591. WRITE( NOUNIT, FMT = 9999 )'DSTEDC(V)', IINFO, N, JTYPE,
  1592. $ IOLDSD
  1593. INFO = ABS( IINFO )
  1594. IF( IINFO.LT.0 ) THEN
  1595. RETURN
  1596. ELSE
  1597. RESULT( 24 ) = ULPINV
  1598. GO TO 280
  1599. END IF
  1600. END IF
  1601. *
  1602. * Do Tests 24 and 25
  1603. *
  1604. CALL DSTT21( N, 0, SD, SE, D1, DUMMA, Z, LDU, WORK,
  1605. $ RESULT( 24 ) )
  1606. *
  1607. * Call DSTEDC(N) to compute D2, do tests.
  1608. *
  1609. * Compute D2
  1610. *
  1611. CALL DCOPY( N, SD, 1, D2, 1 )
  1612. IF( N.GT.0 )
  1613. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1614. CALL DLASET( 'Full', N, N, ZERO, ONE, Z, LDU )
  1615. *
  1616. NTEST = 26
  1617. CALL DSTEDC( 'N', N, D2, WORK, Z, LDU, WORK( N+1 ), LWEDC-N,
  1618. $ IWORK, LIWEDC, IINFO )
  1619. IF( IINFO.NE.0 ) THEN
  1620. WRITE( NOUNIT, FMT = 9999 )'DSTEDC(N)', IINFO, N, JTYPE,
  1621. $ IOLDSD
  1622. INFO = ABS( IINFO )
  1623. IF( IINFO.LT.0 ) THEN
  1624. RETURN
  1625. ELSE
  1626. RESULT( 26 ) = ULPINV
  1627. GO TO 280
  1628. END IF
  1629. END IF
  1630. *
  1631. * Do Test 26
  1632. *
  1633. TEMP1 = ZERO
  1634. TEMP2 = ZERO
  1635. *
  1636. DO 210 J = 1, N
  1637. TEMP1 = MAX( TEMP1, ABS( D1( J ) ), ABS( D2( J ) ) )
  1638. TEMP2 = MAX( TEMP2, ABS( D1( J )-D2( J ) ) )
  1639. 210 CONTINUE
  1640. *
  1641. RESULT( 26 ) = TEMP2 / MAX( UNFL, ULP*MAX( TEMP1, TEMP2 ) )
  1642. *
  1643. * Only test DSTEMR if IEEE compliant
  1644. *
  1645. IF( ILAENV( 10, 'DSTEMR', 'VA', 1, 0, 0, 0 ).EQ.1 .AND.
  1646. $ ILAENV( 11, 'DSTEMR', 'VA', 1, 0, 0, 0 ).EQ.1 ) THEN
  1647. *
  1648. * Call DSTEMR, do test 27 (relative eigenvalue accuracy)
  1649. *
  1650. * If S is positive definite and diagonally dominant,
  1651. * ask for all eigenvalues with high relative accuracy.
  1652. *
  1653. VL = ZERO
  1654. VU = ZERO
  1655. IL = 0
  1656. IU = 0
  1657. IF( JTYPE.EQ.21 .AND. SREL ) THEN
  1658. NTEST = 27
  1659. ABSTOL = UNFL + UNFL
  1660. CALL DSTEMR( 'V', 'A', N, SD, SE, VL, VU, IL, IU,
  1661. $ M, WR, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1662. $ WORK, LWORK, IWORK( 2*N+1 ), LWORK-2*N,
  1663. $ IINFO )
  1664. IF( IINFO.NE.0 ) THEN
  1665. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(V,A,rel)',
  1666. $ IINFO, N, JTYPE, IOLDSD
  1667. INFO = ABS( IINFO )
  1668. IF( IINFO.LT.0 ) THEN
  1669. RETURN
  1670. ELSE
  1671. RESULT( 27 ) = ULPINV
  1672. GO TO 270
  1673. END IF
  1674. END IF
  1675. *
  1676. * Do test 27
  1677. *
  1678. TEMP2 = TWO*( TWO*N-ONE )*ULP*( ONE+EIGHT*HALF**2 ) /
  1679. $ ( ONE-HALF )**4
  1680. *
  1681. TEMP1 = ZERO
  1682. DO 220 J = 1, N
  1683. TEMP1 = MAX( TEMP1, ABS( D4( J )-WR( N-J+1 ) ) /
  1684. $ ( ABSTOL+ABS( D4( J ) ) ) )
  1685. 220 CONTINUE
  1686. *
  1687. RESULT( 27 ) = TEMP1 / TEMP2
  1688. *
  1689. IL = 1 + ( N-1 )*INT( DLARND( 1, ISEED2 ) )
  1690. IU = 1 + ( N-1 )*INT( DLARND( 1, ISEED2 ) )
  1691. IF( IU.LT.IL ) THEN
  1692. ITEMP = IU
  1693. IU = IL
  1694. IL = ITEMP
  1695. END IF
  1696. *
  1697. IF( SRANGE ) THEN
  1698. NTEST = 28
  1699. ABSTOL = UNFL + UNFL
  1700. CALL DSTEMR( 'V', 'I', N, SD, SE, VL, VU, IL, IU,
  1701. $ M, WR, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1702. $ WORK, LWORK, IWORK( 2*N+1 ),
  1703. $ LWORK-2*N, IINFO )
  1704. *
  1705. IF( IINFO.NE.0 ) THEN
  1706. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(V,I,rel)',
  1707. $ IINFO, N, JTYPE, IOLDSD
  1708. INFO = ABS( IINFO )
  1709. IF( IINFO.LT.0 ) THEN
  1710. RETURN
  1711. ELSE
  1712. RESULT( 28 ) = ULPINV
  1713. GO TO 270
  1714. END IF
  1715. END IF
  1716. *
  1717. * Do test 28
  1718. *
  1719. TEMP2 = TWO*( TWO*N-ONE )*ULP*
  1720. $ ( ONE+EIGHT*HALF**2 ) / ( ONE-HALF )**4
  1721. *
  1722. TEMP1 = ZERO
  1723. DO 230 J = IL, IU
  1724. TEMP1 = MAX( TEMP1, ABS( WR( J-IL+1 )-D4( N-J+
  1725. $ 1 ) ) / ( ABSTOL+ABS( WR( J-IL+1 ) ) ) )
  1726. 230 CONTINUE
  1727. *
  1728. RESULT( 28 ) = TEMP1 / TEMP2
  1729. ELSE
  1730. RESULT( 28 ) = ZERO
  1731. END IF
  1732. ELSE
  1733. RESULT( 27 ) = ZERO
  1734. RESULT( 28 ) = ZERO
  1735. END IF
  1736. *
  1737. * Call DSTEMR(V,I) to compute D1 and Z, do tests.
  1738. *
  1739. * Compute D1 and Z
  1740. *
  1741. CALL DCOPY( N, SD, 1, D5, 1 )
  1742. IF( N.GT.0 )
  1743. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1744. CALL DLASET( 'Full', N, N, ZERO, ONE, Z, LDU )
  1745. *
  1746. IF( SRANGE ) THEN
  1747. NTEST = 29
  1748. IL = 1 + ( N-1 )*INT( DLARND( 1, ISEED2 ) )
  1749. IU = 1 + ( N-1 )*INT( DLARND( 1, ISEED2 ) )
  1750. IF( IU.LT.IL ) THEN
  1751. ITEMP = IU
  1752. IU = IL
  1753. IL = ITEMP
  1754. END IF
  1755. CALL DSTEMR( 'V', 'I', N, D5, WORK, VL, VU, IL, IU,
  1756. $ M, D1, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1757. $ WORK( N+1 ), LWORK-N, IWORK( 2*N+1 ),
  1758. $ LIWORK-2*N, IINFO )
  1759. IF( IINFO.NE.0 ) THEN
  1760. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(V,I)', IINFO,
  1761. $ N, JTYPE, IOLDSD
  1762. INFO = ABS( IINFO )
  1763. IF( IINFO.LT.0 ) THEN
  1764. RETURN
  1765. ELSE
  1766. RESULT( 29 ) = ULPINV
  1767. GO TO 280
  1768. END IF
  1769. END IF
  1770. *
  1771. * Do Tests 29 and 30
  1772. *
  1773. CALL DSTT22( N, M, 0, SD, SE, D1, DUMMA, Z, LDU, WORK,
  1774. $ M, RESULT( 29 ) )
  1775. *
  1776. * Call DSTEMR to compute D2, do tests.
  1777. *
  1778. * Compute D2
  1779. *
  1780. CALL DCOPY( N, SD, 1, D5, 1 )
  1781. IF( N.GT.0 )
  1782. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1783. *
  1784. NTEST = 31
  1785. CALL DSTEMR( 'N', 'I', N, D5, WORK, VL, VU, IL, IU,
  1786. $ M, D2, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1787. $ WORK( N+1 ), LWORK-N, IWORK( 2*N+1 ),
  1788. $ LIWORK-2*N, IINFO )
  1789. IF( IINFO.NE.0 ) THEN
  1790. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(N,I)', IINFO,
  1791. $ N, JTYPE, IOLDSD
  1792. INFO = ABS( IINFO )
  1793. IF( IINFO.LT.0 ) THEN
  1794. RETURN
  1795. ELSE
  1796. RESULT( 31 ) = ULPINV
  1797. GO TO 280
  1798. END IF
  1799. END IF
  1800. *
  1801. * Do Test 31
  1802. *
  1803. TEMP1 = ZERO
  1804. TEMP2 = ZERO
  1805. *
  1806. DO 240 J = 1, IU - IL + 1
  1807. TEMP1 = MAX( TEMP1, ABS( D1( J ) ),
  1808. $ ABS( D2( J ) ) )
  1809. TEMP2 = MAX( TEMP2, ABS( D1( J )-D2( J ) ) )
  1810. 240 CONTINUE
  1811. *
  1812. RESULT( 31 ) = TEMP2 / MAX( UNFL,
  1813. $ ULP*MAX( TEMP1, TEMP2 ) )
  1814. *
  1815. * Call DSTEMR(V,V) to compute D1 and Z, do tests.
  1816. *
  1817. * Compute D1 and Z
  1818. *
  1819. CALL DCOPY( N, SD, 1, D5, 1 )
  1820. IF( N.GT.0 )
  1821. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1822. CALL DLASET( 'Full', N, N, ZERO, ONE, Z, LDU )
  1823. *
  1824. NTEST = 32
  1825. *
  1826. IF( N.GT.0 ) THEN
  1827. IF( IL.NE.1 ) THEN
  1828. VL = D2( IL ) - MAX( HALF*
  1829. $ ( D2( IL )-D2( IL-1 ) ), ULP*ANORM,
  1830. $ TWO*RTUNFL )
  1831. ELSE
  1832. VL = D2( 1 ) - MAX( HALF*( D2( N )-D2( 1 ) ),
  1833. $ ULP*ANORM, TWO*RTUNFL )
  1834. END IF
  1835. IF( IU.NE.N ) THEN
  1836. VU = D2( IU ) + MAX( HALF*
  1837. $ ( D2( IU+1 )-D2( IU ) ), ULP*ANORM,
  1838. $ TWO*RTUNFL )
  1839. ELSE
  1840. VU = D2( N ) + MAX( HALF*( D2( N )-D2( 1 ) ),
  1841. $ ULP*ANORM, TWO*RTUNFL )
  1842. END IF
  1843. ELSE
  1844. VL = ZERO
  1845. VU = ONE
  1846. END IF
  1847. *
  1848. CALL DSTEMR( 'V', 'V', N, D5, WORK, VL, VU, IL, IU,
  1849. $ M, D1, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1850. $ WORK( N+1 ), LWORK-N, IWORK( 2*N+1 ),
  1851. $ LIWORK-2*N, IINFO )
  1852. IF( IINFO.NE.0 ) THEN
  1853. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(V,V)', IINFO,
  1854. $ N, JTYPE, IOLDSD
  1855. INFO = ABS( IINFO )
  1856. IF( IINFO.LT.0 ) THEN
  1857. RETURN
  1858. ELSE
  1859. RESULT( 32 ) = ULPINV
  1860. GO TO 280
  1861. END IF
  1862. END IF
  1863. *
  1864. * Do Tests 32 and 33
  1865. *
  1866. CALL DSTT22( N, M, 0, SD, SE, D1, DUMMA, Z, LDU, WORK,
  1867. $ M, RESULT( 32 ) )
  1868. *
  1869. * Call DSTEMR to compute D2, do tests.
  1870. *
  1871. * Compute D2
  1872. *
  1873. CALL DCOPY( N, SD, 1, D5, 1 )
  1874. IF( N.GT.0 )
  1875. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1876. *
  1877. NTEST = 34
  1878. CALL DSTEMR( 'N', 'V', N, D5, WORK, VL, VU, IL, IU,
  1879. $ M, D2, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1880. $ WORK( N+1 ), LWORK-N, IWORK( 2*N+1 ),
  1881. $ LIWORK-2*N, IINFO )
  1882. IF( IINFO.NE.0 ) THEN
  1883. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(N,V)', IINFO,
  1884. $ N, JTYPE, IOLDSD
  1885. INFO = ABS( IINFO )
  1886. IF( IINFO.LT.0 ) THEN
  1887. RETURN
  1888. ELSE
  1889. RESULT( 34 ) = ULPINV
  1890. GO TO 280
  1891. END IF
  1892. END IF
  1893. *
  1894. * Do Test 34
  1895. *
  1896. TEMP1 = ZERO
  1897. TEMP2 = ZERO
  1898. *
  1899. DO 250 J = 1, IU - IL + 1
  1900. TEMP1 = MAX( TEMP1, ABS( D1( J ) ),
  1901. $ ABS( D2( J ) ) )
  1902. TEMP2 = MAX( TEMP2, ABS( D1( J )-D2( J ) ) )
  1903. 250 CONTINUE
  1904. *
  1905. RESULT( 34 ) = TEMP2 / MAX( UNFL,
  1906. $ ULP*MAX( TEMP1, TEMP2 ) )
  1907. ELSE
  1908. RESULT( 29 ) = ZERO
  1909. RESULT( 30 ) = ZERO
  1910. RESULT( 31 ) = ZERO
  1911. RESULT( 32 ) = ZERO
  1912. RESULT( 33 ) = ZERO
  1913. RESULT( 34 ) = ZERO
  1914. END IF
  1915. *
  1916. * Call DSTEMR(V,A) to compute D1 and Z, do tests.
  1917. *
  1918. * Compute D1 and Z
  1919. *
  1920. CALL DCOPY( N, SD, 1, D5, 1 )
  1921. IF( N.GT.0 )
  1922. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1923. *
  1924. NTEST = 35
  1925. *
  1926. CALL DSTEMR( 'V', 'A', N, D5, WORK, VL, VU, IL, IU,
  1927. $ M, D1, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1928. $ WORK( N+1 ), LWORK-N, IWORK( 2*N+1 ),
  1929. $ LIWORK-2*N, IINFO )
  1930. IF( IINFO.NE.0 ) THEN
  1931. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(V,A)', IINFO, N,
  1932. $ JTYPE, IOLDSD
  1933. INFO = ABS( IINFO )
  1934. IF( IINFO.LT.0 ) THEN
  1935. RETURN
  1936. ELSE
  1937. RESULT( 35 ) = ULPINV
  1938. GO TO 280
  1939. END IF
  1940. END IF
  1941. *
  1942. * Do Tests 35 and 36
  1943. *
  1944. CALL DSTT22( N, M, 0, SD, SE, D1, DUMMA, Z, LDU, WORK, M,
  1945. $ RESULT( 35 ) )
  1946. *
  1947. * Call DSTEMR to compute D2, do tests.
  1948. *
  1949. * Compute D2
  1950. *
  1951. CALL DCOPY( N, SD, 1, D5, 1 )
  1952. IF( N.GT.0 )
  1953. $ CALL DCOPY( N-1, SE, 1, WORK, 1 )
  1954. *
  1955. NTEST = 37
  1956. CALL DSTEMR( 'N', 'A', N, D5, WORK, VL, VU, IL, IU,
  1957. $ M, D2, Z, LDU, N, IWORK( 1 ), TRYRAC,
  1958. $ WORK( N+1 ), LWORK-N, IWORK( 2*N+1 ),
  1959. $ LIWORK-2*N, IINFO )
  1960. IF( IINFO.NE.0 ) THEN
  1961. WRITE( NOUNIT, FMT = 9999 )'DSTEMR(N,A)', IINFO, N,
  1962. $ JTYPE, IOLDSD
  1963. INFO = ABS( IINFO )
  1964. IF( IINFO.LT.0 ) THEN
  1965. RETURN
  1966. ELSE
  1967. RESULT( 37 ) = ULPINV
  1968. GO TO 280
  1969. END IF
  1970. END IF
  1971. *
  1972. * Do Test 37
  1973. *
  1974. TEMP1 = ZERO
  1975. TEMP2 = ZERO
  1976. *
  1977. DO 260 J = 1, N
  1978. TEMP1 = MAX( TEMP1, ABS( D1( J ) ), ABS( D2( J ) ) )
  1979. TEMP2 = MAX( TEMP2, ABS( D1( J )-D2( J ) ) )
  1980. 260 CONTINUE
  1981. *
  1982. RESULT( 37 ) = TEMP2 / MAX( UNFL,
  1983. $ ULP*MAX( TEMP1, TEMP2 ) )
  1984. END IF
  1985. 270 CONTINUE
  1986. 280 CONTINUE
  1987. NTESTT = NTESTT + NTEST
  1988. *
  1989. * End of Loop -- Check for RESULT(j) > THRESH
  1990. *
  1991. * Print out tests which fail.
  1992. *
  1993. DO 290 JR = 1, NTEST
  1994. IF( RESULT( JR ).GE.THRESH ) THEN
  1995. *
  1996. * If this is the first test to fail,
  1997. * print a header to the data file.
  1998. *
  1999. IF( NERRS.EQ.0 ) THEN
  2000. WRITE( NOUNIT, FMT = 9998 )'DST'
  2001. WRITE( NOUNIT, FMT = 9997 )
  2002. WRITE( NOUNIT, FMT = 9996 )
  2003. WRITE( NOUNIT, FMT = 9995 )'Symmetric'
  2004. WRITE( NOUNIT, FMT = 9994 )
  2005. *
  2006. * Tests performed
  2007. *
  2008. WRITE( NOUNIT, FMT = 9988 )
  2009. END IF
  2010. NERRS = NERRS + 1
  2011. WRITE( NOUNIT, FMT = 9990 )N, IOLDSD, JTYPE, JR,
  2012. $ RESULT( JR )
  2013. END IF
  2014. 290 CONTINUE
  2015. 300 CONTINUE
  2016. 310 CONTINUE
  2017. *
  2018. * Summary
  2019. *
  2020. CALL DLASUM( 'DST', NOUNIT, NERRS, NTESTT )
  2021. RETURN
  2022. *
  2023. 9999 FORMAT( ' DCHKST2STG: ', A, ' returned INFO=', I6, '.', / 9X,
  2024. $ 'N=', I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ), I5, ')' )
  2025. *
  2026. 9998 FORMAT( / 1X, A3, ' -- Real Symmetric eigenvalue problem' )
  2027. 9997 FORMAT( ' Matrix types (see DCHKST2STG for details): ' )
  2028. *
  2029. 9996 FORMAT( / ' Special Matrices:',
  2030. $ / ' 1=Zero matrix. ',
  2031. $ ' 5=Diagonal: clustered entries.',
  2032. $ / ' 2=Identity matrix. ',
  2033. $ ' 6=Diagonal: large, evenly spaced.',
  2034. $ / ' 3=Diagonal: evenly spaced entries. ',
  2035. $ ' 7=Diagonal: small, evenly spaced.',
  2036. $ / ' 4=Diagonal: geometr. spaced entries.' )
  2037. 9995 FORMAT( ' Dense ', A, ' Matrices:',
  2038. $ / ' 8=Evenly spaced eigenvals. ',
  2039. $ ' 12=Small, evenly spaced eigenvals.',
  2040. $ / ' 9=Geometrically spaced eigenvals. ',
  2041. $ ' 13=Matrix with random O(1) entries.',
  2042. $ / ' 10=Clustered eigenvalues. ',
  2043. $ ' 14=Matrix with large random entries.',
  2044. $ / ' 11=Large, evenly spaced eigenvals. ',
  2045. $ ' 15=Matrix with small random entries.' )
  2046. 9994 FORMAT( ' 16=Positive definite, evenly spaced eigenvalues',
  2047. $ / ' 17=Positive definite, geometrically spaced eigenvlaues',
  2048. $ / ' 18=Positive definite, clustered eigenvalues',
  2049. $ / ' 19=Positive definite, small evenly spaced eigenvalues',
  2050. $ / ' 20=Positive definite, large evenly spaced eigenvalues',
  2051. $ / ' 21=Diagonally dominant tridiagonal, geometrically',
  2052. $ ' spaced eigenvalues' )
  2053. *
  2054. 9990 FORMAT( ' N=', I5, ', seed=', 4( I4, ',' ), ' type ', I2,
  2055. $ ', test(', I2, ')=', G10.3 )
  2056. *
  2057. 9988 FORMAT( / 'Test performed: see DCHKST2STG for details.', / )
  2058. *
  2059. * End of DCHKST2STG
  2060. *
  2061. END