cchkst.c
Go to the documentation of this file.
00001 /* cchkst.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Table of constant values */
00017 
00018 static complex c_b1 = {0.f,0.f};
00019 static complex c_b2 = {1.f,0.f};
00020 static integer c__1 = 1;
00021 static integer c_n1 = -1;
00022 static integer c__2 = 2;
00023 static integer c__0 = 0;
00024 static integer c__6 = 6;
00025 static real c_b39 = 1.f;
00026 static real c_b49 = 0.f;
00027 static integer c__4 = 4;
00028 static integer c__3 = 3;
00029 static integer c__10 = 10;
00030 static integer c__11 = 11;
00031 
00032 /* Subroutine */ int cchkst_(integer *nsizes, integer *nn, integer *ntypes, 
00033         logical *dotype, integer *iseed, real *thresh, integer *nounit, 
00034         complex *a, integer *lda, complex *ap, real *sd, real *se, real *d1, 
00035         real *d2, real *d3, real *d4, real *d5, real *wa1, real *wa2, real *
00036         wa3, real *wr, complex *u, integer *ldu, complex *v, complex *vp, 
00037         complex *tau, complex *z__, complex *work, integer *lwork, real *
00038         rwork, integer *lrwork, integer *iwork, integer *liwork, real *result, 
00039          integer *info)
00040 {
00041     /* Initialized data */
00042 
00043     static integer ktype[21] = { 1,2,4,4,4,4,4,5,5,5,5,5,8,8,8,9,9,9,9,9,10 };
00044     static integer kmagn[21] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3,1,1,1,2,3,1 };
00045     static integer kmode[21] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0,4,3,1,4,4,3 };
00046 
00047     /* Format strings */
00048     static char fmt_9999[] = "(\002 CCHKST: \002,a,\002 returned INFO=\002,i"
00049             "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00050             "(\002,3(i5,\002,\002),i5,\002)\002)";
00051     static char fmt_9998[] = "(/1x,a3,\002 -- Complex Hermitian eigenvalue p"
00052             "roblem\002)";
00053     static char fmt_9997[] = "(\002 Matrix types (see CCHKST for details):"
00054             " \002)";
00055     static char fmt_9996[] = "(/\002 Special Matrices:\002,/\002  1=Zero mat"
00056             "rix.                        \002,\002  5=Diagonal: clustered ent"
00057             "ries.\002,/\002  2=Identity matrix.                    \002,\002"
00058             "  6=Diagonal: large, evenly spaced.\002,/\002  3=Diagonal: evenl"
00059             "y spaced entries.    \002,\002  7=Diagonal: small, evenly spaced."
00060             "\002,/\002  4=Diagonal: geometr. spaced entries.\002)";
00061     static char fmt_9995[] = "(\002 Dense \002,a,\002 Matrices:\002,/\002  8"
00062             "=Evenly spaced eigenvals.            \002,\002 12=Small, evenly "
00063             "spaced eigenvals.\002,/\002  9=Geometrically spaced eigenvals.  "
00064             "   \002,\002 13=Matrix with random O(1) entries.\002,/\002 10=Cl"
00065             "ustered eigenvalues.              \002,\002 14=Matrix with large"
00066             " random entries.\002,/\002 11=Large, evenly spaced eigenvals.   "
00067             "  \002,\002 15=Matrix with small random entries.\002)";
00068     static char fmt_9994[] = "(\002 16=Positive definite, evenly spaced eige"
00069             "nvalues\002,/\002 17=Positive definite, geometrically spaced eig"
00070             "envlaues\002,/\002 18=Positive definite, clustered eigenvalue"
00071             "s\002,/\002 19=Positive definite, small evenly spaced eigenvalues"
00072             "\002,/\002 20=Positive definite, large evenly spaced eigenvalue"
00073             "s\002,/\002 21=Diagonally dominant tridiagonal, geometrically"
00074             "\002,\002 spaced eigenvalues\002)";
00075     static char fmt_9987[] = "(/\002Test performed:  see CCHKST for details"
00076             ".\002,/)";
00077     static char fmt_9989[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00078             ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i3,\002 is\002"
00079             ",0p,f8.2)";
00080     static char fmt_9988[] = "(\002 Matrix order=\002,i5,\002, type=\002,i2"
00081             ",\002, seed=\002,4(i4,\002,\002),\002 result \002,i3,\002 is\002"
00082             ",1p,e10.3)";
00083 
00084     /* System generated locals */
00085     integer a_dim1, a_offset, u_dim1, u_offset, v_dim1, v_offset, z_dim1, 
00086             z_offset, i__1, i__2, i__3, i__4, i__5, i__6;
00087     real r__1, r__2, r__3, r__4;
00088     complex q__1;
00089 
00090     /* Builtin functions */
00091     double log(doublereal), sqrt(doublereal);
00092     integer pow_ii(integer *, integer *);
00093     double c_abs(complex *);
00094     void r_cnjg(complex *, complex *);
00095     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00096 
00097     /* Local variables */
00098     integer i__, j, m, n, m2, m3, jc, il, jr, iu;
00099     real vl, vu;
00100     integer nap, lgn;
00101     real ulp;
00102     integer inde;
00103     real cond;
00104     integer nmax;
00105     real unfl, ovfl, temp1, temp2, temp3, temp4;
00106     logical badnn;
00107     extern doublereal ssxt1_(integer *, real *, integer *, real *, integer *, 
00108             real *, real *, real *);
00109     extern /* Subroutine */ int chet21_(integer *, char *, integer *, integer 
00110             *, complex *, integer *, real *, real *, complex *, integer *, 
00111             complex *, integer *, complex *, complex *, real *, real *);
00112     integer imode, lwedc;
00113     extern /* Subroutine */ int chpt21_(integer *, char *, integer *, integer 
00114             *, complex *, real *, real *, complex *, integer *, complex *, 
00115             complex *, complex *, real *, real *);
00116     real dumma[1];
00117     integer iinfo;
00118     real aninv, anorm;
00119     extern /* Subroutine */ int ccopy_(integer *, complex *, integer *, 
00120             complex *, integer *);
00121     integer itemp;
00122     extern /* Subroutine */ int cstt21_(integer *, integer *, real *, real *, 
00123             real *, real *, complex *, integer *, complex *, real *, real *), 
00124             cstt22_(integer *, integer *, integer *, real *, real *, real *, 
00125             real *, complex *, integer *, complex *, integer *, real *, real *
00126 );
00127     integer nmats, jsize, nerrs, itype, jtype, ntest;
00128     extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *, 
00129             integer *);
00130     integer iseed2[4], log2ui;
00131     extern /* Subroutine */ int slabad_(real *, real *), cstedc_(char *, 
00132             integer *, real *, real *, complex *, integer *, complex *, 
00133             integer *, real *, integer *, integer *, integer *, integer *);
00134     integer liwedc, nblock;
00135     extern doublereal slamch_(char *);
00136     extern /* Subroutine */ int chetrd_(char *, integer *, complex *, integer 
00137             *, real *, real *, complex *, complex *, integer *, integer *), clacpy_(char *, integer *, integer *, complex *, integer 
00138             *, complex *, integer *);
00139     integer idumma[1];
00140     extern /* Subroutine */ int claset_(char *, integer *, integer *, complex 
00141             *, complex *, complex *, integer *);
00142     integer ioldsd[4], lrwedc;
00143     extern integer ilaenv_(integer *, char *, char *, integer *, integer *, 
00144             integer *, integer *);
00145     extern /* Subroutine */ int clatmr_(integer *, integer *, char *, integer 
00146             *, char *, complex *, integer *, real *, complex *, char *, char *
00147 , complex *, integer *, real *, complex *, integer *, real *, 
00148             char *, integer *, integer *, integer *, real *, real *, char *, 
00149             complex *, integer *, integer *, integer *);
00150     extern doublereal slarnd_(integer *, integer *);
00151     real abstol;
00152     extern /* Subroutine */ int chptrd_(char *, integer *, complex *, real *, 
00153             real *, complex *, integer *), clatms_(integer *, integer 
00154             *, char *, integer *, char *, real *, integer *, real *, real *, 
00155             integer *, integer *, char *, complex *, integer *, complex *, 
00156             integer *), cstein_(integer *, real *, 
00157             real *, integer *, real *, integer *, integer *, complex *, 
00158             integer *, real *, integer *, integer *, integer *), xerbla_(char 
00159             *, integer *), sstech_(integer *, real *, real *, real *, 
00160             real *, real *, integer *);
00161     integer indrwk;
00162     extern /* Subroutine */ int cpteqr_(char *, integer *, real *, real *, 
00163             complex *, integer *, real *, integer *), cstemr_(char *, 
00164             char *, integer *, real *, real *, real *, real *, integer *, 
00165             integer *, integer *, real *, complex *, integer *, integer *, 
00166             integer *, logical *, real *, integer *, integer *, integer *, 
00167             integer *), csteqr_(char *, integer *, real *, 
00168             real *, complex *, integer *, real *, integer *), cungtr_(
00169             char *, integer *, complex *, integer *, complex *, complex *, 
00170             integer *, integer *);
00171     logical tryrac;
00172     extern /* Subroutine */ int cupgtr_(char *, integer *, complex *, complex 
00173             *, complex *, integer *, complex *, integer *), slasum_(
00174             char *, integer *, integer *, integer *);
00175     integer nsplit;
00176     real rtunfl, rtovfl, ulpinv;
00177     integer mtypes, ntestt;
00178     extern /* Subroutine */ int sstebz_(char *, char *, integer *, real *, 
00179             real *, integer *, integer *, real *, real *, real *, integer *, 
00180             integer *, real *, integer *, integer *, real *, integer *, 
00181             integer *), ssterf_(integer *, real *, real *, 
00182             integer *);
00183 
00184     /* Fortran I/O blocks */
00185     static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00186     static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00187     static cilist io___44 = { 0, 0, 0, fmt_9999, 0 };
00188     static cilist io___45 = { 0, 0, 0, fmt_9999, 0 };
00189     static cilist io___46 = { 0, 0, 0, fmt_9999, 0 };
00190     static cilist io___48 = { 0, 0, 0, fmt_9999, 0 };
00191     static cilist io___49 = { 0, 0, 0, fmt_9999, 0 };
00192     static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00193     static cilist io___51 = { 0, 0, 0, fmt_9999, 0 };
00194     static cilist io___52 = { 0, 0, 0, fmt_9999, 0 };
00195     static cilist io___53 = { 0, 0, 0, fmt_9999, 0 };
00196     static cilist io___54 = { 0, 0, 0, fmt_9999, 0 };
00197     static cilist io___58 = { 0, 0, 0, fmt_9999, 0 };
00198     static cilist io___59 = { 0, 0, 0, fmt_9999, 0 };
00199     static cilist io___67 = { 0, 0, 0, fmt_9999, 0 };
00200     static cilist io___68 = { 0, 0, 0, fmt_9999, 0 };
00201     static cilist io___71 = { 0, 0, 0, fmt_9999, 0 };
00202     static cilist io___73 = { 0, 0, 0, fmt_9999, 0 };
00203     static cilist io___74 = { 0, 0, 0, fmt_9999, 0 };
00204     static cilist io___75 = { 0, 0, 0, fmt_9999, 0 };
00205     static cilist io___78 = { 0, 0, 0, fmt_9999, 0 };
00206     static cilist io___79 = { 0, 0, 0, fmt_9999, 0 };
00207     static cilist io___80 = { 0, 0, 0, fmt_9999, 0 };
00208     static cilist io___81 = { 0, 0, 0, fmt_9999, 0 };
00209     static cilist io___82 = { 0, 0, 0, fmt_9999, 0 };
00210     static cilist io___83 = { 0, 0, 0, fmt_9999, 0 };
00211     static cilist io___84 = { 0, 0, 0, fmt_9999, 0 };
00212     static cilist io___85 = { 0, 0, 0, fmt_9999, 0 };
00213     static cilist io___86 = { 0, 0, 0, fmt_9999, 0 };
00214     static cilist io___87 = { 0, 0, 0, fmt_9999, 0 };
00215     static cilist io___88 = { 0, 0, 0, fmt_9999, 0 };
00216     static cilist io___89 = { 0, 0, 0, fmt_9998, 0 };
00217     static cilist io___90 = { 0, 0, 0, fmt_9997, 0 };
00218     static cilist io___91 = { 0, 0, 0, fmt_9996, 0 };
00219     static cilist io___92 = { 0, 0, 0, fmt_9995, 0 };
00220     static cilist io___93 = { 0, 0, 0, fmt_9994, 0 };
00221     static cilist io___94 = { 0, 0, 0, fmt_9987, 0 };
00222     static cilist io___95 = { 0, 0, 0, fmt_9989, 0 };
00223     static cilist io___96 = { 0, 0, 0, fmt_9988, 0 };
00224 
00225 
00226 
00227 /*  -- LAPACK test routine (version 3.1) -- */
00228 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00229 /*     November 2006 */
00230 
00231 /*     .. Scalar Arguments .. */
00232 /*     .. */
00233 /*     .. Array Arguments .. */
00234 /*     .. */
00235 
00236 /*  Purpose */
00237 /*  ======= */
00238 
00239 /*  CCHKST  checks the Hermitian eigenvalue problem routines. */
00240 
00241 /*     CHETRD factors A as  U S U* , where * means conjugate transpose, */
00242 /*     S is real symmetric tridiagonal, and U is unitary. */
00243 /*     CHETRD can use either just the lower or just the upper triangle */
00244 /*     of A; CCHKST checks both cases. */
00245 /*     U is represented as a product of Householder */
00246 /*     transformations, whose vectors are stored in the first */
00247 /*     n-1 columns of V, and whose scale factors are in TAU. */
00248 
00249 /*     CHPTRD does the same as CHETRD, except that A and V are stored */
00250 /*     in "packed" format. */
00251 
00252 /*     CUNGTR constructs the matrix U from the contents of V and TAU. */
00253 
00254 /*     CUPGTR constructs the matrix U from the contents of VP and TAU. */
00255 
00256 /*     CSTEQR factors S as  Z D1 Z* , where Z is the unitary */
00257 /*     matrix of eigenvectors and D1 is a diagonal matrix with */
00258 /*     the eigenvalues on the diagonal.  D2 is the matrix of */
00259 /*     eigenvalues computed when Z is not computed. */
00260 
00261 /*     SSTERF computes D3, the matrix of eigenvalues, by the */
00262 /*     PWK method, which does not yield eigenvectors. */
00263 
00264 /*     CPTEQR factors S as  Z4 D4 Z4* , for a */
00265 /*     Hermitian positive definite tridiagonal matrix. */
00266 /*     D5 is the matrix of eigenvalues computed when Z is not */
00267 /*     computed. */
00268 
00269 /*     SSTEBZ computes selected eigenvalues.  WA1, WA2, and */
00270 /*     WA3 will denote eigenvalues computed to high */
00271 /*     absolute accuracy, with different range options. */
00272 /*     WR will denote eigenvalues computed to high relative */
00273 /*     accuracy. */
00274 
00275 /*     CSTEIN computes Y, the eigenvectors of S, given the */
00276 /*     eigenvalues. */
00277 
00278 /*     CSTEDC factors S as Z D1 Z* , where Z is the unitary */
00279 /*     matrix of eigenvectors and D1 is a diagonal matrix with */
00280 /*     the eigenvalues on the diagonal ('I' option). It may also */
00281 /*     update an input unitary matrix, usually the output */
00282 /*     from CHETRD/CUNGTR or CHPTRD/CUPGTR ('V' option). It may */
00283 /*     also just compute eigenvalues ('N' option). */
00284 
00285 /*     CSTEMR factors S as Z D1 Z* , where Z is the unitary */
00286 /*     matrix of eigenvectors and D1 is a diagonal matrix with */
00287 /*     the eigenvalues on the diagonal ('I' option).  CSTEMR */
00288 /*     uses the Relatively Robust Representation whenever possible. */
00289 
00290 /*  When CCHKST is called, a number of matrix "sizes" ("n's") and a */
00291 /*  number of matrix "types" are specified.  For each size ("n") */
00292 /*  and each type of matrix, one matrix will be generated and used */
00293 /*  to test the Hermitian eigenroutines.  For each matrix, a number */
00294 /*  of tests will be performed: */
00295 
00296 /*  (1)     | A - V S V* | / ( |A| n ulp ) CHETRD( UPLO='U', ... ) */
00297 
00298 /*  (2)     | I - UV* | / ( n ulp )        CUNGTR( UPLO='U', ... ) */
00299 
00300 /*  (3)     | A - V S V* | / ( |A| n ulp ) CHETRD( UPLO='L', ... ) */
00301 
00302 /*  (4)     | I - UV* | / ( n ulp )        CUNGTR( UPLO='L', ... ) */
00303 
00304 /*  (5-8)   Same as 1-4, but for CHPTRD and CUPGTR. */
00305 
00306 /*  (9)     | S - Z D Z* | / ( |S| n ulp ) CSTEQR('V',...) */
00307 
00308 /*  (10)    | I - ZZ* | / ( n ulp )        CSTEQR('V',...) */
00309 
00310 /*  (11)    | D1 - D2 | / ( |D1| ulp )        CSTEQR('N',...) */
00311 
00312 /*  (12)    | D1 - D3 | / ( |D1| ulp )        SSTERF */
00313 
00314 /*  (13)    0 if the true eigenvalues (computed by sturm count) */
00315 /*          of S are within THRESH of */
00316 /*          those in D1.  2*THRESH if they are not.  (Tested using */
00317 /*          SSTECH) */
00318 
00319 /*  For S positive definite, */
00320 
00321 /*  (14)    | S - Z4 D4 Z4* | / ( |S| n ulp ) CPTEQR('V',...) */
00322 
00323 /*  (15)    | I - Z4 Z4* | / ( n ulp )        CPTEQR('V',...) */
00324 
00325 /*  (16)    | D4 - D5 | / ( 100 |D4| ulp )       CPTEQR('N',...) */
00326 
00327 /*  When S is also diagonally dominant by the factor gamma < 1, */
00328 
00329 /*  (17)    max | D4(i) - WR(i) | / ( |D4(i)| omega ) , */
00330 /*           i */
00331 /*          omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4 */
00332 /*                                               SSTEBZ( 'A', 'E', ...) */
00333 
00334 /*  (18)    | WA1 - D3 | / ( |D3| ulp )          SSTEBZ( 'A', 'E', ...) */
00335 
00336 /*  (19)    ( max { min | WA2(i)-WA3(j) | } + */
00337 /*             i     j */
00338 /*            max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp ) */
00339 /*             i     j */
00340 /*                                               SSTEBZ( 'I', 'E', ...) */
00341 
00342 /*  (20)    | S - Y WA1 Y* | / ( |S| n ulp )  SSTEBZ, CSTEIN */
00343 
00344 /*  (21)    | I - Y Y* | / ( n ulp )          SSTEBZ, CSTEIN */
00345 
00346 /*  (22)    | S - Z D Z* | / ( |S| n ulp )    CSTEDC('I') */
00347 
00348 /*  (23)    | I - ZZ* | / ( n ulp )           CSTEDC('I') */
00349 
00350 /*  (24)    | S - Z D Z* | / ( |S| n ulp )    CSTEDC('V') */
00351 
00352 /*  (25)    | I - ZZ* | / ( n ulp )           CSTEDC('V') */
00353 
00354 /*  (26)    | D1 - D2 | / ( |D1| ulp )           CSTEDC('V') and */
00355 /*                                               CSTEDC('N') */
00356 
00357 /*  Test 27 is disabled at the moment because CSTEMR does not */
00358 /*  guarantee high relatvie accuracy. */
00359 
00360 /*  (27)    max | D6(i) - WR(i) | / ( |D6(i)| omega ) , */
00361 /*           i */
00362 /*          omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4 */
00363 /*                                               CSTEMR('V', 'A') */
00364 
00365 /*  (28)    max | D6(i) - WR(i) | / ( |D6(i)| omega ) , */
00366 /*           i */
00367 /*          omega = 2 (2n-1) ULP (1 + 8 gamma**2) / (1 - gamma)**4 */
00368 /*                                               CSTEMR('V', 'I') */
00369 
00370 /*  Tests 29 through 34 are disable at present because CSTEMR */
00371 /*  does not handle partial specturm requests. */
00372 
00373 /*  (29)    | S - Z D Z* | / ( |S| n ulp )    CSTEMR('V', 'I') */
00374 
00375 /*  (30)    | I - ZZ* | / ( n ulp )           CSTEMR('V', 'I') */
00376 
00377 /*  (31)    ( max { min | WA2(i)-WA3(j) | } + */
00378 /*             i     j */
00379 /*            max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp ) */
00380 /*             i     j */
00381 /*          CSTEMR('N', 'I') vs. CSTEMR('V', 'I') */
00382 
00383 /*  (32)    | S - Z D Z* | / ( |S| n ulp )    CSTEMR('V', 'V') */
00384 
00385 /*  (33)    | I - ZZ* | / ( n ulp )           CSTEMR('V', 'V') */
00386 
00387 /*  (34)    ( max { min | WA2(i)-WA3(j) | } + */
00388 /*             i     j */
00389 /*            max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp ) */
00390 /*             i     j */
00391 /*          CSTEMR('N', 'V') vs. CSTEMR('V', 'V') */
00392 
00393 /*  (35)    | S - Z D Z* | / ( |S| n ulp )    CSTEMR('V', 'A') */
00394 
00395 /*  (36)    | I - ZZ* | / ( n ulp )           CSTEMR('V', 'A') */
00396 
00397 /*  (37)    ( max { min | WA2(i)-WA3(j) | } + */
00398 /*             i     j */
00399 /*            max { min | WA3(i)-WA2(j) | } ) / ( |D3| ulp ) */
00400 /*             i     j */
00401 /*          CSTEMR('N', 'A') vs. CSTEMR('V', 'A') */
00402 
00403 /*  The "sizes" are specified by an array NN(1:NSIZES); the value of */
00404 /*  each element NN(j) specifies one size. */
00405 /*  The "types" are specified by a logical array DOTYPE( 1:NTYPES ); */
00406 /*  if DOTYPE(j) is .TRUE., then matrix type "j" will be generated. */
00407 /*  Currently, the list of possible types is: */
00408 
00409 /*  (1)  The zero matrix. */
00410 /*  (2)  The identity matrix. */
00411 
00412 /*  (3)  A diagonal matrix with evenly spaced entries */
00413 /*       1, ..., ULP  and random signs. */
00414 /*       (ULP = (first number larger than 1) - 1 ) */
00415 /*  (4)  A diagonal matrix with geometrically spaced entries */
00416 /*       1, ..., ULP  and random signs. */
00417 /*  (5)  A diagonal matrix with "clustered" entries 1, ULP, ..., ULP */
00418 /*       and random signs. */
00419 
00420 /*  (6)  Same as (4), but multiplied by SQRT( overflow threshold ) */
00421 /*  (7)  Same as (4), but multiplied by SQRT( underflow threshold ) */
00422 
00423 /*  (8)  A matrix of the form  U* D U, where U is unitary and */
00424 /*       D has evenly spaced entries 1, ..., ULP with random signs */
00425 /*       on the diagonal. */
00426 
00427 /*  (9)  A matrix of the form  U* D U, where U is unitary and */
00428 /*       D has geometrically spaced entries 1, ..., ULP with random */
00429 /*       signs on the diagonal. */
00430 
00431 /*  (10) A matrix of the form  U* D U, where U is unitary and */
00432 /*       D has "clustered" entries 1, ULP,..., ULP with random */
00433 /*       signs on the diagonal. */
00434 
00435 /*  (11) Same as (8), but multiplied by SQRT( overflow threshold ) */
00436 /*  (12) Same as (8), but multiplied by SQRT( underflow threshold ) */
00437 
00438 /*  (13) Hermitian matrix with random entries chosen from (-1,1). */
00439 /*  (14) Same as (13), but multiplied by SQRT( overflow threshold ) */
00440 /*  (15) Same as (13), but multiplied by SQRT( underflow threshold ) */
00441 /*  (16) Same as (8), but diagonal elements are all positive. */
00442 /*  (17) Same as (9), but diagonal elements are all positive. */
00443 /*  (18) Same as (10), but diagonal elements are all positive. */
00444 /*  (19) Same as (16), but multiplied by SQRT( overflow threshold ) */
00445 /*  (20) Same as (16), but multiplied by SQRT( underflow threshold ) */
00446 /*  (21) A diagonally dominant tridiagonal matrix with geometrically */
00447 /*       spaced diagonal entries 1, ..., ULP. */
00448 
00449 /*  Arguments */
00450 /*  ========= */
00451 
00452 /*  NSIZES  (input) INTEGER */
00453 /*          The number of sizes of matrices to use.  If it is zero, */
00454 /*          CCHKST does nothing.  It must be at least zero. */
00455 
00456 /*  NN      (input) INTEGER array, dimension (NSIZES) */
00457 /*          An array containing the sizes to be used for the matrices. */
00458 /*          Zero values will be skipped.  The values must be at least */
00459 /*          zero. */
00460 
00461 /*  NTYPES  (input) INTEGER */
00462 /*          The number of elements in DOTYPE.   If it is zero, CCHKST */
00463 /*          does nothing.  It must be at least zero.  If it is MAXTYP+1 */
00464 /*          and NSIZES is 1, then an additional type, MAXTYP+1 is */
00465 /*          defined, which is to use whatever matrix is in A.  This */
00466 /*          is only useful if DOTYPE(1:MAXTYP) is .FALSE. and */
00467 /*          DOTYPE(MAXTYP+1) is .TRUE. . */
00468 
00469 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00470 /*          If DOTYPE(j) is .TRUE., then for each size in NN a */
00471 /*          matrix of that size and of type j will be generated. */
00472 /*          If NTYPES is smaller than the maximum number of types */
00473 /*          defined (PARAMETER MAXTYP), then types NTYPES+1 through */
00474 /*          MAXTYP will not be generated.  If NTYPES is larger */
00475 /*          than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) */
00476 /*          will be ignored. */
00477 
00478 /*  ISEED   (input/output) INTEGER array, dimension (4) */
00479 /*          On entry ISEED specifies the seed of the random number */
00480 /*          generator. The array elements should be between 0 and 4095; */
00481 /*          if not they will be reduced mod 4096.  Also, ISEED(4) must */
00482 /*          be odd.  The random number generator uses a linear */
00483 /*          congruential sequence limited to small integers, and so */
00484 /*          should produce machine independent random numbers. The */
00485 /*          values of ISEED are changed on exit, and can be used in the */
00486 /*          next call to CCHKST to continue the same random number */
00487 /*          sequence. */
00488 
00489 /*  THRESH  (input) REAL */
00490 /*          A test will count as "failed" if the "error", computed as */
00491 /*          described above, exceeds THRESH.  Note that the error */
00492 /*          is scaled to be O(1), so THRESH should be a reasonably */
00493 /*          small multiple of 1, e.g., 10 or 100.  In particular, */
00494 /*          it should not depend on the precision (single vs. double) */
00495 /*          or the size of the matrix.  It must be at least zero. */
00496 
00497 /*  NOUNIT  (input) INTEGER */
00498 /*          The FORTRAN unit number for printing out error messages */
00499 /*          (e.g., if a routine returns IINFO not equal to 0.) */
00500 
00501 /*  A       (input/workspace/output) COMPLEX array of */
00502 /*                                  dimension ( LDA , max(NN) ) */
00503 /*          Used to hold the matrix whose eigenvalues are to be */
00504 /*          computed.  On exit, A contains the last matrix actually */
00505 /*          used. */
00506 
00507 /*  LDA     (input) INTEGER */
00508 /*          The leading dimension of A.  It must be at */
00509 /*          least 1 and at least max( NN ). */
00510 
00511 /*  AP      (workspace) COMPLEX array of */
00512 /*                      dimension( max(NN)*max(NN+1)/2 ) */
00513 /*          The matrix A stored in packed format. */
00514 
00515 /*  SD      (workspace/output) REAL array of */
00516 /*                             dimension( max(NN) ) */
00517 /*          The diagonal of the tridiagonal matrix computed by CHETRD. */
00518 /*          On exit, SD and SE contain the tridiagonal form of the */
00519 /*          matrix in A. */
00520 
00521 /*  SE      (workspace/output) REAL array of */
00522 /*                             dimension( max(NN) ) */
00523 /*          The off-diagonal of the tridiagonal matrix computed by */
00524 /*          CHETRD.  On exit, SD and SE contain the tridiagonal form of */
00525 /*          the matrix in A. */
00526 
00527 /*  D1      (workspace/output) REAL array of */
00528 /*                             dimension( max(NN) ) */
00529 /*          The eigenvalues of A, as computed by CSTEQR simlutaneously */
00530 /*          with Z.  On exit, the eigenvalues in D1 correspond with the */
00531 /*          matrix in A. */
00532 
00533 /*  D2      (workspace/output) REAL array of */
00534 /*                             dimension( max(NN) ) */
00535 /*          The eigenvalues of A, as computed by CSTEQR if Z is not */
00536 /*          computed.  On exit, the eigenvalues in D2 correspond with */
00537 /*          the matrix in A. */
00538 
00539 /*  D3      (workspace/output) REAL array of */
00540 /*                             dimension( max(NN) ) */
00541 /*          The eigenvalues of A, as computed by SSTERF.  On exit, the */
00542 /*          eigenvalues in D3 correspond with the matrix in A. */
00543 
00544 /*  U       (workspace/output) COMPLEX array of */
00545 /*                             dimension( LDU, max(NN) ). */
00546 /*          The unitary matrix computed by CHETRD + CUNGTR. */
00547 
00548 /*  LDU     (input) INTEGER */
00549 /*          The leading dimension of U, Z, and V.  It must be at least 1 */
00550 /*          and at least max( NN ). */
00551 
00552 /*  V       (workspace/output) COMPLEX array of */
00553 /*                             dimension( LDU, max(NN) ). */
00554 /*          The Housholder vectors computed by CHETRD in reducing A to */
00555 /*          tridiagonal form.  The vectors computed with UPLO='U' are */
00556 /*          in the upper triangle, and the vectors computed with UPLO='L' */
00557 /*          are in the lower triangle.  (As described in CHETRD, the */
00558 /*          sub- and superdiagonal are not set to 1, although the */
00559 /*          true Householder vector has a 1 in that position.  The */
00560 /*          routines that use V, such as CUNGTR, set those entries to */
00561 /*          1 before using them, and then restore them later.) */
00562 
00563 /*  VP      (workspace) COMPLEX array of */
00564 /*                      dimension( max(NN)*max(NN+1)/2 ) */
00565 /*          The matrix V stored in packed format. */
00566 
00567 /*  TAU     (workspace/output) COMPLEX array of */
00568 /*                             dimension( max(NN) ) */
00569 /*          The Householder factors computed by CHETRD in reducing A */
00570 /*          to tridiagonal form. */
00571 
00572 /*  Z       (workspace/output) COMPLEX array of */
00573 /*                             dimension( LDU, max(NN) ). */
00574 /*          The unitary matrix of eigenvectors computed by CSTEQR, */
00575 /*          CPTEQR, and CSTEIN. */
00576 
00577 /*  WORK    (workspace/output) COMPLEX array of */
00578 /*                      dimension( LWORK ) */
00579 
00580 /*  LWORK   (input) INTEGER */
00581 /*          The number of entries in WORK.  This must be at least */
00582 /*          1 + 4 * Nmax + 2 * Nmax * lg Nmax + 3 * Nmax**2 */
00583 /*          where Nmax = max( NN(j), 2 ) and lg = log base 2. */
00584 
00585 /*  IWORK   (workspace/output) INTEGER array, */
00586 /*             dimension (6 + 6*Nmax + 5 * Nmax * lg Nmax ) */
00587 /*          where Nmax = max( NN(j), 2 ) and lg = log base 2. */
00588 /*          Workspace. */
00589 
00590 /*  RWORK   (workspace/output) REAL array of */
00591 /*                      dimension( ??? ) */
00592 
00593 /*  RESULT  (output) REAL array, dimension (26) */
00594 /*          The values computed by the tests described above. */
00595 /*          The values are currently limited to 1/ulp, to avoid */
00596 /*          overflow. */
00597 
00598 /*  INFO    (output) INTEGER */
00599 /*          If 0, then everything ran OK. */
00600 /*           -1: NSIZES < 0 */
00601 /*           -2: Some NN(j) < 0 */
00602 /*           -3: NTYPES < 0 */
00603 /*           -5: THRESH < 0 */
00604 /*           -9: LDA < 1 or LDA < NMAX, where NMAX is max( NN(j) ). */
00605 /*          -23: LDU < 1 or LDU < NMAX. */
00606 /*          -29: LWORK too small. */
00607 /*          If  CLATMR, CLATMS, CHETRD, CUNGTR, CSTEQR, SSTERF, */
00608 /*              or CUNMC2 returns an error code, the */
00609 /*              absolute value of it is returned. */
00610 
00611 /* ----------------------------------------------------------------------- */
00612 
00613 /*       Some Local Variables and Parameters: */
00614 /*       ---- ----- --------- --- ---------- */
00615 /*       ZERO, ONE       Real 0 and 1. */
00616 /*       MAXTYP          The number of types defined. */
00617 /*       NTEST           The number of tests performed, or which can */
00618 /*                       be performed so far, for the current matrix. */
00619 /*       NTESTT          The total number of tests performed so far. */
00620 /*       NBLOCK          Blocksize as returned by ENVIR. */
00621 /*       NMAX            Largest value in NN. */
00622 /*       NMATS           The number of matrices generated so far. */
00623 /*       NERRS           The number of tests which have exceeded THRESH */
00624 /*                       so far. */
00625 /*       COND, IMODE     Values to be passed to the matrix generators. */
00626 /*       ANORM           Norm of A; passed to matrix generators. */
00627 
00628 /*       OVFL, UNFL      Overflow and underflow thresholds. */
00629 /*       ULP, ULPINV     Finest relative precision and its inverse. */
00630 /*       RTOVFL, RTUNFL  Square roots of the previous 2 values. */
00631 /*               The following four arrays decode JTYPE: */
00632 /*       KTYPE(j)        The general type (1-10) for type "j". */
00633 /*       KMODE(j)        The MODE value to be passed to the matrix */
00634 /*                       generator for type "j". */
00635 /*       KMAGN(j)        The order of magnitude ( O(1), */
00636 /*                       O(overflow^(1/2) ), O(underflow^(1/2) ) */
00637 
00638 /*  ===================================================================== */
00639 
00640 /*     .. Parameters .. */
00641 /*     .. */
00642 /*     .. Local Scalars .. */
00643 /*     .. */
00644 /*     .. Local Arrays .. */
00645 /*     .. */
00646 /*     .. External Functions .. */
00647 /*     .. */
00648 /*     .. External Subroutines .. */
00649 /*     .. */
00650 /*     .. Intrinsic Functions .. */
00651 /*     .. */
00652 /*     .. Data statements .. */
00653     /* Parameter adjustments */
00654     --nn;
00655     --dotype;
00656     --iseed;
00657     a_dim1 = *lda;
00658     a_offset = 1 + a_dim1;
00659     a -= a_offset;
00660     --ap;
00661     --sd;
00662     --se;
00663     --d1;
00664     --d2;
00665     --d3;
00666     --d4;
00667     --d5;
00668     --wa1;
00669     --wa2;
00670     --wa3;
00671     --wr;
00672     z_dim1 = *ldu;
00673     z_offset = 1 + z_dim1;
00674     z__ -= z_offset;
00675     v_dim1 = *ldu;
00676     v_offset = 1 + v_dim1;
00677     v -= v_offset;
00678     u_dim1 = *ldu;
00679     u_offset = 1 + u_dim1;
00680     u -= u_offset;
00681     --vp;
00682     --tau;
00683     --work;
00684     --rwork;
00685     --iwork;
00686     --result;
00687 
00688     /* Function Body */
00689 /*     .. */
00690 /*     .. Executable Statements .. */
00691 
00692 /*     Keep ftnchek happy */
00693     idumma[0] = 1;
00694 
00695 /*     Check for errors */
00696 
00697     ntestt = 0;
00698     *info = 0;
00699 
00700 /*     Important constants */
00701 
00702     badnn = FALSE_;
00703     tryrac = TRUE_;
00704     nmax = 1;
00705     i__1 = *nsizes;
00706     for (j = 1; j <= i__1; ++j) {
00707 /* Computing MAX */
00708         i__2 = nmax, i__3 = nn[j];
00709         nmax = max(i__2,i__3);
00710         if (nn[j] < 0) {
00711             badnn = TRUE_;
00712         }
00713 /* L10: */
00714     }
00715 
00716     nblock = ilaenv_(&c__1, "CHETRD", "L", &nmax, &c_n1, &c_n1, &c_n1);
00717 /* Computing MIN */
00718     i__1 = nmax, i__2 = max(1,nblock);
00719     nblock = min(i__1,i__2);
00720 
00721 /*     Check for errors */
00722 
00723     if (*nsizes < 0) {
00724         *info = -1;
00725     } else if (badnn) {
00726         *info = -2;
00727     } else if (*ntypes < 0) {
00728         *info = -3;
00729     } else if (*lda < nmax) {
00730         *info = -9;
00731     } else if (*ldu < nmax) {
00732         *info = -23;
00733     } else /* if(complicated condition) */ {
00734 /* Computing 2nd power */
00735         i__1 = max(2,nmax);
00736         if (i__1 * i__1 << 1 > *lwork) {
00737             *info = -29;
00738         }
00739     }
00740 
00741     if (*info != 0) {
00742         i__1 = -(*info);
00743         xerbla_("CCHKST", &i__1);
00744         return 0;
00745     }
00746 
00747 /*     Quick return if possible */
00748 
00749     if (*nsizes == 0 || *ntypes == 0) {
00750         return 0;
00751     }
00752 
00753 /*     More Important constants */
00754 
00755     unfl = slamch_("Safe minimum");
00756     ovfl = 1.f / unfl;
00757     slabad_(&unfl, &ovfl);
00758     ulp = slamch_("Epsilon") * slamch_("Base");
00759     ulpinv = 1.f / ulp;
00760     log2ui = (integer) (log(ulpinv) / log(2.f));
00761     rtunfl = sqrt(unfl);
00762     rtovfl = sqrt(ovfl);
00763 
00764 /*     Loop over sizes, types */
00765 
00766     for (i__ = 1; i__ <= 4; ++i__) {
00767         iseed2[i__ - 1] = iseed[i__];
00768 /* L20: */
00769     }
00770     nerrs = 0;
00771     nmats = 0;
00772 
00773     i__1 = *nsizes;
00774     for (jsize = 1; jsize <= i__1; ++jsize) {
00775         n = nn[jsize];
00776         if (n > 0) {
00777             lgn = (integer) (log((real) n) / log(2.f));
00778             if (pow_ii(&c__2, &lgn) < n) {
00779                 ++lgn;
00780             }
00781             if (pow_ii(&c__2, &lgn) < n) {
00782                 ++lgn;
00783             }
00784 /* Computing 2nd power */
00785             i__2 = n;
00786             lwedc = (n << 2) + 1 + (n << 1) * lgn + i__2 * i__2 * 3;
00787 /* Computing 2nd power */
00788             i__2 = n;
00789             lrwedc = n * 3 + 1 + (n << 1) * lgn + i__2 * i__2 * 3;
00790             liwedc = n * 6 + 6 + n * 5 * lgn;
00791         } else {
00792             lwedc = 8;
00793             lrwedc = 7;
00794             liwedc = 12;
00795         }
00796         nap = n * (n + 1) / 2;
00797         aninv = 1.f / (real) max(1,n);
00798 
00799         if (*nsizes != 1) {
00800             mtypes = min(21,*ntypes);
00801         } else {
00802             mtypes = min(22,*ntypes);
00803         }
00804 
00805         i__2 = mtypes;
00806         for (jtype = 1; jtype <= i__2; ++jtype) {
00807             if (! dotype[jtype]) {
00808                 goto L300;
00809             }
00810             ++nmats;
00811             ntest = 0;
00812 
00813             for (j = 1; j <= 4; ++j) {
00814                 ioldsd[j - 1] = iseed[j];
00815 /* L30: */
00816             }
00817 
00818 /*           Compute "A" */
00819 
00820 /*           Control parameters: */
00821 
00822 /*               KMAGN  KMODE        KTYPE */
00823 /*           =1  O(1)   clustered 1  zero */
00824 /*           =2  large  clustered 2  identity */
00825 /*           =3  small  exponential  (none) */
00826 /*           =4         arithmetic   diagonal, (w/ eigenvalues) */
00827 /*           =5         random log   Hermitian, w/ eigenvalues */
00828 /*           =6         random       (none) */
00829 /*           =7                      random diagonal */
00830 /*           =8                      random Hermitian */
00831 /*           =9                      positive definite */
00832 /*           =10                     diagonally dominant tridiagonal */
00833 
00834             if (mtypes > 21) {
00835                 goto L100;
00836             }
00837 
00838             itype = ktype[jtype - 1];
00839             imode = kmode[jtype - 1];
00840 
00841 /*           Compute norm */
00842 
00843             switch (kmagn[jtype - 1]) {
00844                 case 1:  goto L40;
00845                 case 2:  goto L50;
00846                 case 3:  goto L60;
00847             }
00848 
00849 L40:
00850             anorm = 1.f;
00851             goto L70;
00852 
00853 L50:
00854             anorm = rtovfl * ulp * aninv;
00855             goto L70;
00856 
00857 L60:
00858             anorm = rtunfl * n * ulpinv;
00859             goto L70;
00860 
00861 L70:
00862 
00863             claset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00864             iinfo = 0;
00865             if (jtype <= 15) {
00866                 cond = ulpinv;
00867             } else {
00868                 cond = ulpinv * aninv / 10.f;
00869             }
00870 
00871 /*           Special Matrices -- Identity & Jordan block */
00872 
00873 /*              Zero */
00874 
00875             if (itype == 1) {
00876                 iinfo = 0;
00877 
00878             } else if (itype == 2) {
00879 
00880 /*              Identity */
00881 
00882                 i__3 = n;
00883                 for (jc = 1; jc <= i__3; ++jc) {
00884                     i__4 = jc + jc * a_dim1;
00885                     a[i__4].r = anorm, a[i__4].i = 0.f;
00886 /* L80: */
00887                 }
00888 
00889             } else if (itype == 4) {
00890 
00891 /*              Diagonal Matrix, [Eigen]values Specified */
00892 
00893                 clatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond, 
00894                          &anorm, &c__0, &c__0, "N", &a[a_offset], lda, &work[
00895                         1], &iinfo);
00896 
00897 
00898             } else if (itype == 5) {
00899 
00900 /*              Hermitian, eigenvalues specified */
00901 
00902                 clatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond, 
00903                          &anorm, &n, &n, "N", &a[a_offset], lda, &work[1], &
00904                         iinfo);
00905 
00906             } else if (itype == 7) {
00907 
00908 /*              Diagonal, random eigenvalues */
00909 
00910                 clatmr_(&n, &n, "S", &iseed[1], "H", &work[1], &c__6, &c_b39, 
00911                         &c_b2, "T", "N", &work[n + 1], &c__1, &c_b39, &work[(
00912                         n << 1) + 1], &c__1, &c_b39, "N", idumma, &c__0, &
00913                         c__0, &c_b49, &anorm, "NO", &a[a_offset], lda, &iwork[
00914                         1], &iinfo);
00915 
00916             } else if (itype == 8) {
00917 
00918 /*              Hermitian, random eigenvalues */
00919 
00920                 clatmr_(&n, &n, "S", &iseed[1], "H", &work[1], &c__6, &c_b39, 
00921                         &c_b2, "T", "N", &work[n + 1], &c__1, &c_b39, &work[(
00922                         n << 1) + 1], &c__1, &c_b39, "N", idumma, &n, &n, &
00923                         c_b49, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00924                         iinfo);
00925 
00926             } else if (itype == 9) {
00927 
00928 /*              Positive definite, eigenvalues specified. */
00929 
00930                 clatms_(&n, &n, "S", &iseed[1], "P", &rwork[1], &imode, &cond, 
00931                          &anorm, &n, &n, "N", &a[a_offset], lda, &work[1], &
00932                         iinfo);
00933 
00934             } else if (itype == 10) {
00935 
00936 /*              Positive definite tridiagonal, eigenvalues specified. */
00937 
00938                 clatms_(&n, &n, "S", &iseed[1], "P", &rwork[1], &imode, &cond, 
00939                          &anorm, &c__1, &c__1, "N", &a[a_offset], lda, &work[
00940                         1], &iinfo);
00941                 i__3 = n;
00942                 for (i__ = 2; i__ <= i__3; ++i__) {
00943                     temp1 = c_abs(&a[i__ - 1 + i__ * a_dim1]);
00944                     i__4 = i__ - 1 + (i__ - 1) * a_dim1;
00945                     i__5 = i__ + i__ * a_dim1;
00946                     q__1.r = a[i__4].r * a[i__5].r - a[i__4].i * a[i__5].i, 
00947                             q__1.i = a[i__4].r * a[i__5].i + a[i__4].i * a[
00948                             i__5].r;
00949                     temp2 = sqrt(c_abs(&q__1));
00950                     if (temp1 > temp2 * .5f) {
00951                         i__4 = i__ - 1 + i__ * a_dim1;
00952                         i__5 = i__ - 1 + i__ * a_dim1;
00953                         r__1 = temp2 * .5f / (unfl + temp1);
00954                         q__1.r = r__1 * a[i__5].r, q__1.i = r__1 * a[i__5].i;
00955                         a[i__4].r = q__1.r, a[i__4].i = q__1.i;
00956                         i__4 = i__ + (i__ - 1) * a_dim1;
00957                         r_cnjg(&q__1, &a[i__ - 1 + i__ * a_dim1]);
00958                         a[i__4].r = q__1.r, a[i__4].i = q__1.i;
00959                     }
00960 /* L90: */
00961                 }
00962 
00963             } else {
00964 
00965                 iinfo = 1;
00966             }
00967 
00968             if (iinfo != 0) {
00969                 io___42.ciunit = *nounit;
00970                 s_wsfe(&io___42);
00971                 do_fio(&c__1, "Generator", (ftnlen)9);
00972                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00973                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00974                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00975                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00976                 e_wsfe();
00977                 *info = abs(iinfo);
00978                 return 0;
00979             }
00980 
00981 L100:
00982 
00983 /*           Call CHETRD and CUNGTR to compute S and U from */
00984 /*           upper triangle. */
00985 
00986             clacpy_("U", &n, &n, &a[a_offset], lda, &v[v_offset], ldu);
00987 
00988             ntest = 1;
00989             chetrd_("U", &n, &v[v_offset], ldu, &sd[1], &se[1], &tau[1], &
00990                     work[1], lwork, &iinfo);
00991 
00992             if (iinfo != 0) {
00993                 io___43.ciunit = *nounit;
00994                 s_wsfe(&io___43);
00995                 do_fio(&c__1, "CHETRD(U)", (ftnlen)9);
00996                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00997                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00998                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00999                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01000                 e_wsfe();
01001                 *info = abs(iinfo);
01002                 if (iinfo < 0) {
01003                     return 0;
01004                 } else {
01005                     result[1] = ulpinv;
01006                     goto L280;
01007                 }
01008             }
01009 
01010             clacpy_("U", &n, &n, &v[v_offset], ldu, &u[u_offset], ldu);
01011 
01012             ntest = 2;
01013             cungtr_("U", &n, &u[u_offset], ldu, &tau[1], &work[1], lwork, &
01014                     iinfo);
01015             if (iinfo != 0) {
01016                 io___44.ciunit = *nounit;
01017                 s_wsfe(&io___44);
01018                 do_fio(&c__1, "CUNGTR(U)", (ftnlen)9);
01019                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01020                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01021                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01022                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01023                 e_wsfe();
01024                 *info = abs(iinfo);
01025                 if (iinfo < 0) {
01026                     return 0;
01027                 } else {
01028                     result[2] = ulpinv;
01029                     goto L280;
01030                 }
01031             }
01032 
01033 /*           Do tests 1 and 2 */
01034 
01035             chet21_(&c__2, "Upper", &n, &c__1, &a[a_offset], lda, &sd[1], &se[
01036                     1], &u[u_offset], ldu, &v[v_offset], ldu, &tau[1], &work[
01037                     1], &rwork[1], &result[1]);
01038             chet21_(&c__3, "Upper", &n, &c__1, &a[a_offset], lda, &sd[1], &se[
01039                     1], &u[u_offset], ldu, &v[v_offset], ldu, &tau[1], &work[
01040                     1], &rwork[1], &result[2]);
01041 
01042 /*           Call CHETRD and CUNGTR to compute S and U from */
01043 /*           lower triangle, do tests. */
01044 
01045             clacpy_("L", &n, &n, &a[a_offset], lda, &v[v_offset], ldu);
01046 
01047             ntest = 3;
01048             chetrd_("L", &n, &v[v_offset], ldu, &sd[1], &se[1], &tau[1], &
01049                     work[1], lwork, &iinfo);
01050 
01051             if (iinfo != 0) {
01052                 io___45.ciunit = *nounit;
01053                 s_wsfe(&io___45);
01054                 do_fio(&c__1, "CHETRD(L)", (ftnlen)9);
01055                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01056                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01057                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01058                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01059                 e_wsfe();
01060                 *info = abs(iinfo);
01061                 if (iinfo < 0) {
01062                     return 0;
01063                 } else {
01064                     result[3] = ulpinv;
01065                     goto L280;
01066                 }
01067             }
01068 
01069             clacpy_("L", &n, &n, &v[v_offset], ldu, &u[u_offset], ldu);
01070 
01071             ntest = 4;
01072             cungtr_("L", &n, &u[u_offset], ldu, &tau[1], &work[1], lwork, &
01073                     iinfo);
01074             if (iinfo != 0) {
01075                 io___46.ciunit = *nounit;
01076                 s_wsfe(&io___46);
01077                 do_fio(&c__1, "CUNGTR(L)", (ftnlen)9);
01078                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01079                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01080                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01081                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01082                 e_wsfe();
01083                 *info = abs(iinfo);
01084                 if (iinfo < 0) {
01085                     return 0;
01086                 } else {
01087                     result[4] = ulpinv;
01088                     goto L280;
01089                 }
01090             }
01091 
01092             chet21_(&c__2, "Lower", &n, &c__1, &a[a_offset], lda, &sd[1], &se[
01093                     1], &u[u_offset], ldu, &v[v_offset], ldu, &tau[1], &work[
01094                     1], &rwork[1], &result[3]);
01095             chet21_(&c__3, "Lower", &n, &c__1, &a[a_offset], lda, &sd[1], &se[
01096                     1], &u[u_offset], ldu, &v[v_offset], ldu, &tau[1], &work[
01097                     1], &rwork[1], &result[4]);
01098 
01099 /*           Store the upper triangle of A in AP */
01100 
01101             i__ = 0;
01102             i__3 = n;
01103             for (jc = 1; jc <= i__3; ++jc) {
01104                 i__4 = jc;
01105                 for (jr = 1; jr <= i__4; ++jr) {
01106                     ++i__;
01107                     i__5 = i__;
01108                     i__6 = jr + jc * a_dim1;
01109                     ap[i__5].r = a[i__6].r, ap[i__5].i = a[i__6].i;
01110 /* L110: */
01111                 }
01112 /* L120: */
01113             }
01114 
01115 /*           Call CHPTRD and CUPGTR to compute S and U from AP */
01116 
01117             ccopy_(&nap, &ap[1], &c__1, &vp[1], &c__1);
01118 
01119             ntest = 5;
01120             chptrd_("U", &n, &vp[1], &sd[1], &se[1], &tau[1], &iinfo);
01121 
01122             if (iinfo != 0) {
01123                 io___48.ciunit = *nounit;
01124                 s_wsfe(&io___48);
01125                 do_fio(&c__1, "CHPTRD(U)", (ftnlen)9);
01126                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01127                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01128                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01129                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01130                 e_wsfe();
01131                 *info = abs(iinfo);
01132                 if (iinfo < 0) {
01133                     return 0;
01134                 } else {
01135                     result[5] = ulpinv;
01136                     goto L280;
01137                 }
01138             }
01139 
01140             ntest = 6;
01141             cupgtr_("U", &n, &vp[1], &tau[1], &u[u_offset], ldu, &work[1], &
01142                     iinfo);
01143             if (iinfo != 0) {
01144                 io___49.ciunit = *nounit;
01145                 s_wsfe(&io___49);
01146                 do_fio(&c__1, "CUPGTR(U)", (ftnlen)9);
01147                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01148                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01149                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01150                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01151                 e_wsfe();
01152                 *info = abs(iinfo);
01153                 if (iinfo < 0) {
01154                     return 0;
01155                 } else {
01156                     result[6] = ulpinv;
01157                     goto L280;
01158                 }
01159             }
01160 
01161 /*           Do tests 5 and 6 */
01162 
01163             chpt21_(&c__2, "Upper", &n, &c__1, &ap[1], &sd[1], &se[1], &u[
01164                     u_offset], ldu, &vp[1], &tau[1], &work[1], &rwork[1], &
01165                     result[5]);
01166             chpt21_(&c__3, "Upper", &n, &c__1, &ap[1], &sd[1], &se[1], &u[
01167                     u_offset], ldu, &vp[1], &tau[1], &work[1], &rwork[1], &
01168                     result[6]);
01169 
01170 /*           Store the lower triangle of A in AP */
01171 
01172             i__ = 0;
01173             i__3 = n;
01174             for (jc = 1; jc <= i__3; ++jc) {
01175                 i__4 = n;
01176                 for (jr = jc; jr <= i__4; ++jr) {
01177                     ++i__;
01178                     i__5 = i__;
01179                     i__6 = jr + jc * a_dim1;
01180                     ap[i__5].r = a[i__6].r, ap[i__5].i = a[i__6].i;
01181 /* L130: */
01182                 }
01183 /* L140: */
01184             }
01185 
01186 /*           Call CHPTRD and CUPGTR to compute S and U from AP */
01187 
01188             ccopy_(&nap, &ap[1], &c__1, &vp[1], &c__1);
01189 
01190             ntest = 7;
01191             chptrd_("L", &n, &vp[1], &sd[1], &se[1], &tau[1], &iinfo);
01192 
01193             if (iinfo != 0) {
01194                 io___50.ciunit = *nounit;
01195                 s_wsfe(&io___50);
01196                 do_fio(&c__1, "CHPTRD(L)", (ftnlen)9);
01197                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01198                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01199                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01200                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01201                 e_wsfe();
01202                 *info = abs(iinfo);
01203                 if (iinfo < 0) {
01204                     return 0;
01205                 } else {
01206                     result[7] = ulpinv;
01207                     goto L280;
01208                 }
01209             }
01210 
01211             ntest = 8;
01212             cupgtr_("L", &n, &vp[1], &tau[1], &u[u_offset], ldu, &work[1], &
01213                     iinfo);
01214             if (iinfo != 0) {
01215                 io___51.ciunit = *nounit;
01216                 s_wsfe(&io___51);
01217                 do_fio(&c__1, "CUPGTR(L)", (ftnlen)9);
01218                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01219                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01220                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01221                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01222                 e_wsfe();
01223                 *info = abs(iinfo);
01224                 if (iinfo < 0) {
01225                     return 0;
01226                 } else {
01227                     result[8] = ulpinv;
01228                     goto L280;
01229                 }
01230             }
01231 
01232             chpt21_(&c__2, "Lower", &n, &c__1, &ap[1], &sd[1], &se[1], &u[
01233                     u_offset], ldu, &vp[1], &tau[1], &work[1], &rwork[1], &
01234                     result[7]);
01235             chpt21_(&c__3, "Lower", &n, &c__1, &ap[1], &sd[1], &se[1], &u[
01236                     u_offset], ldu, &vp[1], &tau[1], &work[1], &rwork[1], &
01237                     result[8]);
01238 
01239 /*           Call CSTEQR to compute D1, D2, and Z, do tests. */
01240 
01241 /*           Compute D1 and Z */
01242 
01243             scopy_(&n, &sd[1], &c__1, &d1[1], &c__1);
01244             if (n > 0) {
01245                 i__3 = n - 1;
01246                 scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
01247             }
01248             claset_("Full", &n, &n, &c_b1, &c_b2, &z__[z_offset], ldu);
01249 
01250             ntest = 9;
01251             csteqr_("V", &n, &d1[1], &rwork[1], &z__[z_offset], ldu, &rwork[n 
01252                     + 1], &iinfo);
01253             if (iinfo != 0) {
01254                 io___52.ciunit = *nounit;
01255                 s_wsfe(&io___52);
01256                 do_fio(&c__1, "CSTEQR(V)", (ftnlen)9);
01257                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01258                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01259                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01260                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01261                 e_wsfe();
01262                 *info = abs(iinfo);
01263                 if (iinfo < 0) {
01264                     return 0;
01265                 } else {
01266                     result[9] = ulpinv;
01267                     goto L280;
01268                 }
01269             }
01270 
01271 /*           Compute D2 */
01272 
01273             scopy_(&n, &sd[1], &c__1, &d2[1], &c__1);
01274             if (n > 0) {
01275                 i__3 = n - 1;
01276                 scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
01277             }
01278 
01279             ntest = 11;
01280             csteqr_("N", &n, &d2[1], &rwork[1], &work[1], ldu, &rwork[n + 1], 
01281                     &iinfo);
01282             if (iinfo != 0) {
01283                 io___53.ciunit = *nounit;
01284                 s_wsfe(&io___53);
01285                 do_fio(&c__1, "CSTEQR(N)", (ftnlen)9);
01286                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01287                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01288                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01289                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01290                 e_wsfe();
01291                 *info = abs(iinfo);
01292                 if (iinfo < 0) {
01293                     return 0;
01294                 } else {
01295                     result[11] = ulpinv;
01296                     goto L280;
01297                 }
01298             }
01299 
01300 /*           Compute D3 (using PWK method) */
01301 
01302             scopy_(&n, &sd[1], &c__1, &d3[1], &c__1);
01303             if (n > 0) {
01304                 i__3 = n - 1;
01305                 scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
01306             }
01307 
01308             ntest = 12;
01309             ssterf_(&n, &d3[1], &rwork[1], &iinfo);
01310             if (iinfo != 0) {
01311                 io___54.ciunit = *nounit;
01312                 s_wsfe(&io___54);
01313                 do_fio(&c__1, "SSTERF", (ftnlen)6);
01314                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01315                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01316                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01317                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01318                 e_wsfe();
01319                 *info = abs(iinfo);
01320                 if (iinfo < 0) {
01321                     return 0;
01322                 } else {
01323                     result[12] = ulpinv;
01324                     goto L280;
01325                 }
01326             }
01327 
01328 /*           Do Tests 9 and 10 */
01329 
01330             cstt21_(&n, &c__0, &sd[1], &se[1], &d1[1], dumma, &z__[z_offset], 
01331                     ldu, &work[1], &rwork[1], &result[9]);
01332 
01333 /*           Do Tests 11 and 12 */
01334 
01335             temp1 = 0.f;
01336             temp2 = 0.f;
01337             temp3 = 0.f;
01338             temp4 = 0.f;
01339 
01340             i__3 = n;
01341             for (j = 1; j <= i__3; ++j) {
01342 /* Computing MAX */
01343                 r__3 = temp1, r__4 = (r__1 = d1[j], dabs(r__1)), r__3 = max(
01344                         r__3,r__4), r__4 = (r__2 = d2[j], dabs(r__2));
01345                 temp1 = dmax(r__3,r__4);
01346 /* Computing MAX */
01347                 r__2 = temp2, r__3 = (r__1 = d1[j] - d2[j], dabs(r__1));
01348                 temp2 = dmax(r__2,r__3);
01349 /* Computing MAX */
01350                 r__3 = temp3, r__4 = (r__1 = d1[j], dabs(r__1)), r__3 = max(
01351                         r__3,r__4), r__4 = (r__2 = d3[j], dabs(r__2));
01352                 temp3 = dmax(r__3,r__4);
01353 /* Computing MAX */
01354                 r__2 = temp4, r__3 = (r__1 = d1[j] - d3[j], dabs(r__1));
01355                 temp4 = dmax(r__2,r__3);
01356 /* L150: */
01357             }
01358 
01359 /* Computing MAX */
01360             r__1 = unfl, r__2 = ulp * dmax(temp1,temp2);
01361             result[11] = temp2 / dmax(r__1,r__2);
01362 /* Computing MAX */
01363             r__1 = unfl, r__2 = ulp * dmax(temp3,temp4);
01364             result[12] = temp4 / dmax(r__1,r__2);
01365 
01366 /*           Do Test 13 -- Sturm Sequence Test of Eigenvalues */
01367 /*                         Go up by factors of two until it succeeds */
01368 
01369             ntest = 13;
01370             temp1 = *thresh * (.5f - ulp);
01371 
01372             i__3 = log2ui;
01373             for (j = 0; j <= i__3; ++j) {
01374                 sstech_(&n, &sd[1], &se[1], &d1[1], &temp1, &rwork[1], &iinfo)
01375                         ;
01376                 if (iinfo == 0) {
01377                     goto L170;
01378                 }
01379                 temp1 *= 2.f;
01380 /* L160: */
01381             }
01382 
01383 L170:
01384             result[13] = temp1;
01385 
01386 /*           For positive definite matrices ( JTYPE.GT.15 ) call CPTEQR */
01387 /*           and do tests 14, 15, and 16 . */
01388 
01389             if (jtype > 15) {
01390 
01391 /*              Compute D4 and Z4 */
01392 
01393                 scopy_(&n, &sd[1], &c__1, &d4[1], &c__1);
01394                 if (n > 0) {
01395                     i__3 = n - 1;
01396                     scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
01397                 }
01398                 claset_("Full", &n, &n, &c_b1, &c_b2, &z__[z_offset], ldu);
01399 
01400                 ntest = 14;
01401                 cpteqr_("V", &n, &d4[1], &rwork[1], &z__[z_offset], ldu, &
01402                         rwork[n + 1], &iinfo);
01403                 if (iinfo != 0) {
01404                     io___58.ciunit = *nounit;
01405                     s_wsfe(&io___58);
01406                     do_fio(&c__1, "CPTEQR(V)", (ftnlen)9);
01407                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01408                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01409                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01410                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01411                             ;
01412                     e_wsfe();
01413                     *info = abs(iinfo);
01414                     if (iinfo < 0) {
01415                         return 0;
01416                     } else {
01417                         result[14] = ulpinv;
01418                         goto L280;
01419                     }
01420                 }
01421 
01422 /*              Do Tests 14 and 15 */
01423 
01424                 cstt21_(&n, &c__0, &sd[1], &se[1], &d4[1], dumma, &z__[
01425                         z_offset], ldu, &work[1], &rwork[1], &result[14]);
01426 
01427 /*              Compute D5 */
01428 
01429                 scopy_(&n, &sd[1], &c__1, &d5[1], &c__1);
01430                 if (n > 0) {
01431                     i__3 = n - 1;
01432                     scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
01433                 }
01434 
01435                 ntest = 16;
01436                 cpteqr_("N", &n, &d5[1], &rwork[1], &z__[z_offset], ldu, &
01437                         rwork[n + 1], &iinfo);
01438                 if (iinfo != 0) {
01439                     io___59.ciunit = *nounit;
01440                     s_wsfe(&io___59);
01441                     do_fio(&c__1, "CPTEQR(N)", (ftnlen)9);
01442                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01443                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01444                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01445                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01446                             ;
01447                     e_wsfe();
01448                     *info = abs(iinfo);
01449                     if (iinfo < 0) {
01450                         return 0;
01451                     } else {
01452                         result[16] = ulpinv;
01453                         goto L280;
01454                     }
01455                 }
01456 
01457 /*              Do Test 16 */
01458 
01459                 temp1 = 0.f;
01460                 temp2 = 0.f;
01461                 i__3 = n;
01462                 for (j = 1; j <= i__3; ++j) {
01463 /* Computing MAX */
01464                     r__3 = temp1, r__4 = (r__1 = d4[j], dabs(r__1)), r__3 = 
01465                             max(r__3,r__4), r__4 = (r__2 = d5[j], dabs(r__2));
01466                     temp1 = dmax(r__3,r__4);
01467 /* Computing MAX */
01468                     r__2 = temp2, r__3 = (r__1 = d4[j] - d5[j], dabs(r__1));
01469                     temp2 = dmax(r__2,r__3);
01470 /* L180: */
01471                 }
01472 
01473 /* Computing MAX */
01474                 r__1 = unfl, r__2 = ulp * 100.f * dmax(temp1,temp2);
01475                 result[16] = temp2 / dmax(r__1,r__2);
01476             } else {
01477                 result[14] = 0.f;
01478                 result[15] = 0.f;
01479                 result[16] = 0.f;
01480             }
01481 
01482 /*           Call SSTEBZ with different options and do tests 17-18. */
01483 
01484 /*              If S is positive definite and diagonally dominant, */
01485 /*              ask for all eigenvalues with high relative accuracy. */
01486 
01487             vl = 0.f;
01488             vu = 0.f;
01489             il = 0;
01490             iu = 0;
01491             if (jtype == 21) {
01492                 ntest = 17;
01493                 abstol = unfl + unfl;
01494                 sstebz_("A", "E", &n, &vl, &vu, &il, &iu, &abstol, &sd[1], &
01495                         se[1], &m, &nsplit, &wr[1], &iwork[1], &iwork[n + 1], 
01496                         &rwork[1], &iwork[(n << 1) + 1], &iinfo);
01497                 if (iinfo != 0) {
01498                     io___67.ciunit = *nounit;
01499                     s_wsfe(&io___67);
01500                     do_fio(&c__1, "SSTEBZ(A,rel)", (ftnlen)13);
01501                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01502                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01503                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01504                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01505                             ;
01506                     e_wsfe();
01507                     *info = abs(iinfo);
01508                     if (iinfo < 0) {
01509                         return 0;
01510                     } else {
01511                         result[17] = ulpinv;
01512                         goto L280;
01513                     }
01514                 }
01515 
01516 /*              Do test 17 */
01517 
01518                 temp2 = (n * 2.f - 1.f) * 2.f * ulp * 3.f / .0625f;
01519 
01520                 temp1 = 0.f;
01521                 i__3 = n;
01522                 for (j = 1; j <= i__3; ++j) {
01523 /* Computing MAX */
01524                     r__3 = temp1, r__4 = (r__2 = d4[j] - wr[n - j + 1], dabs(
01525                             r__2)) / (abstol + (r__1 = d4[j], dabs(r__1)));
01526                     temp1 = dmax(r__3,r__4);
01527 /* L190: */
01528                 }
01529 
01530                 result[17] = temp1 / temp2;
01531             } else {
01532                 result[17] = 0.f;
01533             }
01534 
01535 /*           Now ask for all eigenvalues with high absolute accuracy. */
01536 
01537             ntest = 18;
01538             abstol = unfl + unfl;
01539             sstebz_("A", "E", &n, &vl, &vu, &il, &iu, &abstol, &sd[1], &se[1], 
01540                      &m, &nsplit, &wa1[1], &iwork[1], &iwork[n + 1], &rwork[1]
01541 , &iwork[(n << 1) + 1], &iinfo);
01542             if (iinfo != 0) {
01543                 io___68.ciunit = *nounit;
01544                 s_wsfe(&io___68);
01545                 do_fio(&c__1, "SSTEBZ(A)", (ftnlen)9);
01546                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01547                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01548                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01549                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01550                 e_wsfe();
01551                 *info = abs(iinfo);
01552                 if (iinfo < 0) {
01553                     return 0;
01554                 } else {
01555                     result[18] = ulpinv;
01556                     goto L280;
01557                 }
01558             }
01559 
01560 /*           Do test 18 */
01561 
01562             temp1 = 0.f;
01563             temp2 = 0.f;
01564             i__3 = n;
01565             for (j = 1; j <= i__3; ++j) {
01566 /* Computing MAX */
01567                 r__3 = temp1, r__4 = (r__1 = d3[j], dabs(r__1)), r__3 = max(
01568                         r__3,r__4), r__4 = (r__2 = wa1[j], dabs(r__2));
01569                 temp1 = dmax(r__3,r__4);
01570 /* Computing MAX */
01571                 r__2 = temp2, r__3 = (r__1 = d3[j] - wa1[j], dabs(r__1));
01572                 temp2 = dmax(r__2,r__3);
01573 /* L200: */
01574             }
01575 
01576 /* Computing MAX */
01577             r__1 = unfl, r__2 = ulp * dmax(temp1,temp2);
01578             result[18] = temp2 / dmax(r__1,r__2);
01579 
01580 /*           Choose random values for IL and IU, and ask for the */
01581 /*           IL-th through IU-th eigenvalues. */
01582 
01583             ntest = 19;
01584             if (n <= 1) {
01585                 il = 1;
01586                 iu = n;
01587             } else {
01588                 il = (n - 1) * (integer) slarnd_(&c__1, iseed2) + 1;
01589                 iu = (n - 1) * (integer) slarnd_(&c__1, iseed2) + 1;
01590                 if (iu < il) {
01591                     itemp = iu;
01592                     iu = il;
01593                     il = itemp;
01594                 }
01595             }
01596 
01597             sstebz_("I", "E", &n, &vl, &vu, &il, &iu, &abstol, &sd[1], &se[1], 
01598                      &m2, &nsplit, &wa2[1], &iwork[1], &iwork[n + 1], &rwork[
01599                     1], &iwork[(n << 1) + 1], &iinfo);
01600             if (iinfo != 0) {
01601                 io___71.ciunit = *nounit;
01602                 s_wsfe(&io___71);
01603                 do_fio(&c__1, "SSTEBZ(I)", (ftnlen)9);
01604                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01605                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01606                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01607                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01608                 e_wsfe();
01609                 *info = abs(iinfo);
01610                 if (iinfo < 0) {
01611                     return 0;
01612                 } else {
01613                     result[19] = ulpinv;
01614                     goto L280;
01615                 }
01616             }
01617 
01618 /*           Determine the values VL and VU of the IL-th and IU-th */
01619 /*           eigenvalues and ask for all eigenvalues in this range. */
01620 
01621             if (n > 0) {
01622                 if (il != 1) {
01623 /* Computing MAX */
01624                     r__1 = (wa1[il] - wa1[il - 1]) * .5f, r__2 = ulp * anorm, 
01625                             r__1 = max(r__1,r__2), r__2 = rtunfl * 2.f;
01626                     vl = wa1[il] - dmax(r__1,r__2);
01627                 } else {
01628 /* Computing MAX */
01629                     r__1 = (wa1[n] - wa1[1]) * .5f, r__2 = ulp * anorm, r__1 =
01630                              max(r__1,r__2), r__2 = rtunfl * 2.f;
01631                     vl = wa1[1] - dmax(r__1,r__2);
01632                 }
01633                 if (iu != n) {
01634 /* Computing MAX */
01635                     r__1 = (wa1[iu + 1] - wa1[iu]) * .5f, r__2 = ulp * anorm, 
01636                             r__1 = max(r__1,r__2), r__2 = rtunfl * 2.f;
01637                     vu = wa1[iu] + dmax(r__1,r__2);
01638                 } else {
01639 /* Computing MAX */
01640                     r__1 = (wa1[n] - wa1[1]) * .5f, r__2 = ulp * anorm, r__1 =
01641                              max(r__1,r__2), r__2 = rtunfl * 2.f;
01642                     vu = wa1[n] + dmax(r__1,r__2);
01643                 }
01644             } else {
01645                 vl = 0.f;
01646                 vu = 1.f;
01647             }
01648 
01649             sstebz_("V", "E", &n, &vl, &vu, &il, &iu, &abstol, &sd[1], &se[1], 
01650                      &m3, &nsplit, &wa3[1], &iwork[1], &iwork[n + 1], &rwork[
01651                     1], &iwork[(n << 1) + 1], &iinfo);
01652             if (iinfo != 0) {
01653                 io___73.ciunit = *nounit;
01654                 s_wsfe(&io___73);
01655                 do_fio(&c__1, "SSTEBZ(V)", (ftnlen)9);
01656                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01657                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01658                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01659                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01660                 e_wsfe();
01661                 *info = abs(iinfo);
01662                 if (iinfo < 0) {
01663                     return 0;
01664                 } else {
01665                     result[19] = ulpinv;
01666                     goto L280;
01667                 }
01668             }
01669 
01670             if (m3 == 0 && n != 0) {
01671                 result[19] = ulpinv;
01672                 goto L280;
01673             }
01674 
01675 /*           Do test 19 */
01676 
01677             temp1 = ssxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &ulp, &
01678                     unfl);
01679             temp2 = ssxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &ulp, &
01680                     unfl);
01681             if (n > 0) {
01682 /* Computing MAX */
01683                 r__2 = (r__1 = wa1[n], dabs(r__1)), r__3 = dabs(wa1[1]);
01684                 temp3 = dmax(r__2,r__3);
01685             } else {
01686                 temp3 = 0.f;
01687             }
01688 
01689 /* Computing MAX */
01690             r__1 = unfl, r__2 = temp3 * ulp;
01691             result[19] = (temp1 + temp2) / dmax(r__1,r__2);
01692 
01693 /*           Call CSTEIN to compute eigenvectors corresponding to */
01694 /*           eigenvalues in WA1.  (First call SSTEBZ again, to make sure */
01695 /*           it returns these eigenvalues in the correct order.) */
01696 
01697             ntest = 21;
01698             sstebz_("A", "B", &n, &vl, &vu, &il, &iu, &abstol, &sd[1], &se[1], 
01699                      &m, &nsplit, &wa1[1], &iwork[1], &iwork[n + 1], &rwork[1]
01700 , &iwork[(n << 1) + 1], &iinfo);
01701             if (iinfo != 0) {
01702                 io___74.ciunit = *nounit;
01703                 s_wsfe(&io___74);
01704                 do_fio(&c__1, "SSTEBZ(A,B)", (ftnlen)11);
01705                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01706                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01707                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01708                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01709                 e_wsfe();
01710                 *info = abs(iinfo);
01711                 if (iinfo < 0) {
01712                     return 0;
01713                 } else {
01714                     result[20] = ulpinv;
01715                     result[21] = ulpinv;
01716                     goto L280;
01717                 }
01718             }
01719 
01720             cstein_(&n, &sd[1], &se[1], &m, &wa1[1], &iwork[1], &iwork[n + 1], 
01721                      &z__[z_offset], ldu, &rwork[1], &iwork[(n << 1) + 1], &
01722                     iwork[n * 3 + 1], &iinfo);
01723             if (iinfo != 0) {
01724                 io___75.ciunit = *nounit;
01725                 s_wsfe(&io___75);
01726                 do_fio(&c__1, "CSTEIN", (ftnlen)6);
01727                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01728                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01729                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01730                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01731                 e_wsfe();
01732                 *info = abs(iinfo);
01733                 if (iinfo < 0) {
01734                     return 0;
01735                 } else {
01736                     result[20] = ulpinv;
01737                     result[21] = ulpinv;
01738                     goto L280;
01739                 }
01740             }
01741 
01742 /*           Do tests 20 and 21 */
01743 
01744             cstt21_(&n, &c__0, &sd[1], &se[1], &wa1[1], dumma, &z__[z_offset], 
01745                      ldu, &work[1], &rwork[1], &result[20]);
01746 
01747 /*           Call CSTEDC(I) to compute D1 and Z, do tests. */
01748 
01749 /*           Compute D1 and Z */
01750 
01751             inde = 1;
01752             indrwk = inde + n;
01753             scopy_(&n, &sd[1], &c__1, &d1[1], &c__1);
01754             if (n > 0) {
01755                 i__3 = n - 1;
01756                 scopy_(&i__3, &se[1], &c__1, &rwork[inde], &c__1);
01757             }
01758             claset_("Full", &n, &n, &c_b1, &c_b2, &z__[z_offset], ldu);
01759 
01760             ntest = 22;
01761             cstedc_("I", &n, &d1[1], &rwork[inde], &z__[z_offset], ldu, &work[
01762                     1], &lwedc, &rwork[indrwk], &lrwedc, &iwork[1], &liwedc, &
01763                     iinfo);
01764             if (iinfo != 0) {
01765                 io___78.ciunit = *nounit;
01766                 s_wsfe(&io___78);
01767                 do_fio(&c__1, "CSTEDC(I)", (ftnlen)9);
01768                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01769                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01770                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01771                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01772                 e_wsfe();
01773                 *info = abs(iinfo);
01774                 if (iinfo < 0) {
01775                     return 0;
01776                 } else {
01777                     result[22] = ulpinv;
01778                     goto L280;
01779                 }
01780             }
01781 
01782 /*           Do Tests 22 and 23 */
01783 
01784             cstt21_(&n, &c__0, &sd[1], &se[1], &d1[1], dumma, &z__[z_offset], 
01785                     ldu, &work[1], &rwork[1], &result[22]);
01786 
01787 /*           Call CSTEDC(V) to compute D1 and Z, do tests. */
01788 
01789 /*           Compute D1 and Z */
01790 
01791             scopy_(&n, &sd[1], &c__1, &d1[1], &c__1);
01792             if (n > 0) {
01793                 i__3 = n - 1;
01794                 scopy_(&i__3, &se[1], &c__1, &rwork[inde], &c__1);
01795             }
01796             claset_("Full", &n, &n, &c_b1, &c_b2, &z__[z_offset], ldu);
01797 
01798             ntest = 24;
01799             cstedc_("V", &n, &d1[1], &rwork[inde], &z__[z_offset], ldu, &work[
01800                     1], &lwedc, &rwork[indrwk], &lrwedc, &iwork[1], &liwedc, &
01801                     iinfo);
01802             if (iinfo != 0) {
01803                 io___79.ciunit = *nounit;
01804                 s_wsfe(&io___79);
01805                 do_fio(&c__1, "CSTEDC(V)", (ftnlen)9);
01806                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01807                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01808                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01809                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01810                 e_wsfe();
01811                 *info = abs(iinfo);
01812                 if (iinfo < 0) {
01813                     return 0;
01814                 } else {
01815                     result[24] = ulpinv;
01816                     goto L280;
01817                 }
01818             }
01819 
01820 /*           Do Tests 24 and 25 */
01821 
01822             cstt21_(&n, &c__0, &sd[1], &se[1], &d1[1], dumma, &z__[z_offset], 
01823                     ldu, &work[1], &rwork[1], &result[24]);
01824 
01825 /*           Call CSTEDC(N) to compute D2, do tests. */
01826 
01827 /*           Compute D2 */
01828 
01829             scopy_(&n, &sd[1], &c__1, &d2[1], &c__1);
01830             if (n > 0) {
01831                 i__3 = n - 1;
01832                 scopy_(&i__3, &se[1], &c__1, &rwork[inde], &c__1);
01833             }
01834             claset_("Full", &n, &n, &c_b1, &c_b2, &z__[z_offset], ldu);
01835 
01836             ntest = 26;
01837             cstedc_("N", &n, &d2[1], &rwork[inde], &z__[z_offset], ldu, &work[
01838                     1], &lwedc, &rwork[indrwk], &lrwedc, &iwork[1], &liwedc, &
01839                     iinfo);
01840             if (iinfo != 0) {
01841                 io___80.ciunit = *nounit;
01842                 s_wsfe(&io___80);
01843                 do_fio(&c__1, "CSTEDC(N)", (ftnlen)9);
01844                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01845                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01846                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01847                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01848                 e_wsfe();
01849                 *info = abs(iinfo);
01850                 if (iinfo < 0) {
01851                     return 0;
01852                 } else {
01853                     result[26] = ulpinv;
01854                     goto L280;
01855                 }
01856             }
01857 
01858 /*           Do Test 26 */
01859 
01860             temp1 = 0.f;
01861             temp2 = 0.f;
01862 
01863             i__3 = n;
01864             for (j = 1; j <= i__3; ++j) {
01865 /* Computing MAX */
01866                 r__3 = temp1, r__4 = (r__1 = d1[j], dabs(r__1)), r__3 = max(
01867                         r__3,r__4), r__4 = (r__2 = d2[j], dabs(r__2));
01868                 temp1 = dmax(r__3,r__4);
01869 /* Computing MAX */
01870                 r__2 = temp2, r__3 = (r__1 = d1[j] - d2[j], dabs(r__1));
01871                 temp2 = dmax(r__2,r__3);
01872 /* L210: */
01873             }
01874 
01875 /* Computing MAX */
01876             r__1 = unfl, r__2 = ulp * dmax(temp1,temp2);
01877             result[26] = temp2 / dmax(r__1,r__2);
01878 
01879 /*           Only test CSTEMR if IEEE compliant */
01880 
01881             if (ilaenv_(&c__10, "CSTEMR", "VA", &c__1, &c__0, &c__0, &c__0) == 1 && ilaenv_(&c__11, "CSTEMR", 
01882                     "VA", &c__1, &c__0, &c__0, &c__0) ==
01883                      1) {
01884 
01885 /*           Call CSTEMR, do test 27 (relative eigenvalue accuracy) */
01886 
01887 /*              If S is positive definite and diagonally dominant, */
01888 /*              ask for all eigenvalues with high relative accuracy. */
01889 
01890                 vl = 0.f;
01891                 vu = 0.f;
01892                 il = 0;
01893                 iu = 0;
01894                 if (FALSE_) {
01895                     ntest = 27;
01896                     abstol = unfl + unfl;
01897                     i__3 = *lwork - (n << 1);
01898                     cstemr_("V", "A", &n, &sd[1], &se[1], &vl, &vu, &il, &iu, 
01899                             &m, &wr[1], &z__[z_offset], ldu, &n, &iwork[1], &
01900                             tryrac, &rwork[1], lrwork, &iwork[(n << 1) + 1], &
01901                             i__3, &iinfo);
01902                     if (iinfo != 0) {
01903                         io___81.ciunit = *nounit;
01904                         s_wsfe(&io___81);
01905                         do_fio(&c__1, "CSTEMR(V,A,rel)", (ftnlen)15);
01906                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01907                                 ;
01908                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01909                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01910                                 ;
01911                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01912                                 integer));
01913                         e_wsfe();
01914                         *info = abs(iinfo);
01915                         if (iinfo < 0) {
01916                             return 0;
01917                         } else {
01918                             result[27] = ulpinv;
01919                             goto L270;
01920                         }
01921                     }
01922 
01923 /*              Do test 27 */
01924 
01925                     temp2 = (n * 2.f - 1.f) * 2.f * ulp * 3.f / .0625f;
01926 
01927                     temp1 = 0.f;
01928                     i__3 = n;
01929                     for (j = 1; j <= i__3; ++j) {
01930 /* Computing MAX */
01931                         r__3 = temp1, r__4 = (r__2 = d4[j] - wr[n - j + 1], 
01932                                 dabs(r__2)) / (abstol + (r__1 = d4[j], dabs(
01933                                 r__1)));
01934                         temp1 = dmax(r__3,r__4);
01935 /* L220: */
01936                     }
01937 
01938                     result[27] = temp1 / temp2;
01939 
01940                     il = (n - 1) * (integer) slarnd_(&c__1, iseed2) + 1;
01941                     iu = (n - 1) * (integer) slarnd_(&c__1, iseed2) + 1;
01942                     if (iu < il) {
01943                         itemp = iu;
01944                         iu = il;
01945                         il = itemp;
01946                     }
01947 
01948                     if (FALSE_) {
01949                         ntest = 28;
01950                         abstol = unfl + unfl;
01951                         i__3 = *lwork - (n << 1);
01952                         cstemr_("V", "I", &n, &sd[1], &se[1], &vl, &vu, &il, &
01953                                 iu, &m, &wr[1], &z__[z_offset], ldu, &n, &
01954                                 iwork[1], &tryrac, &rwork[1], lrwork, &iwork[(
01955                                 n << 1) + 1], &i__3, &iinfo);
01956 
01957                         if (iinfo != 0) {
01958                             io___82.ciunit = *nounit;
01959                             s_wsfe(&io___82);
01960                             do_fio(&c__1, "CSTEMR(V,I,rel)", (ftnlen)15);
01961                             do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01962                                     integer));
01963                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01964                                     ;
01965                             do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01966                                     integer));
01967                             do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01968                                     integer));
01969                             e_wsfe();
01970                             *info = abs(iinfo);
01971                             if (iinfo < 0) {
01972                                 return 0;
01973                             } else {
01974                                 result[28] = ulpinv;
01975                                 goto L270;
01976                             }
01977                         }
01978 
01979 
01980 /*                 Do test 28 */
01981 
01982                         temp2 = (n * 2.f - 1.f) * 2.f * ulp * 3.f / .0625f;
01983 
01984                         temp1 = 0.f;
01985                         i__3 = iu;
01986                         for (j = il; j <= i__3; ++j) {
01987 /* Computing MAX */
01988                             r__3 = temp1, r__4 = (r__2 = wr[j - il + 1] - d4[
01989                                     n - j + 1], dabs(r__2)) / (abstol + (r__1 
01990                                     = wr[j - il + 1], dabs(r__1)));
01991                             temp1 = dmax(r__3,r__4);
01992 /* L230: */
01993                         }
01994 
01995                         result[28] = temp1 / temp2;
01996                     } else {
01997                         result[28] = 0.f;
01998                     }
01999                 } else {
02000                     result[27] = 0.f;
02001                     result[28] = 0.f;
02002                 }
02003 
02004 /*           Call CSTEMR(V,I) to compute D1 and Z, do tests. */
02005 
02006 /*           Compute D1 and Z */
02007 
02008                 scopy_(&n, &sd[1], &c__1, &d5[1], &c__1);
02009                 if (n > 0) {
02010                     i__3 = n - 1;
02011                     scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
02012                 }
02013                 claset_("Full", &n, &n, &c_b1, &c_b2, &z__[z_offset], ldu);
02014 
02015                 if (FALSE_) {
02016                     ntest = 29;
02017                     il = (n - 1) * (integer) slarnd_(&c__1, iseed2) + 1;
02018                     iu = (n - 1) * (integer) slarnd_(&c__1, iseed2) + 1;
02019                     if (iu < il) {
02020                         itemp = iu;
02021                         iu = il;
02022                         il = itemp;
02023                     }
02024                     i__3 = *lrwork - n;
02025                     i__4 = *liwork - (n << 1);
02026                     cstemr_("V", "I", &n, &d5[1], &rwork[1], &vl, &vu, &il, &
02027                             iu, &m, &d1[1], &z__[z_offset], ldu, &n, &iwork[1]
02028 , &tryrac, &rwork[n + 1], &i__3, &iwork[(n << 1) 
02029                             + 1], &i__4, &iinfo);
02030                     if (iinfo != 0) {
02031                         io___83.ciunit = *nounit;
02032                         s_wsfe(&io___83);
02033                         do_fio(&c__1, "CSTEMR(V,I)", (ftnlen)11);
02034                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
02035                                 ;
02036                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02037                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
02038                                 ;
02039                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
02040                                 integer));
02041                         e_wsfe();
02042                         *info = abs(iinfo);
02043                         if (iinfo < 0) {
02044                             return 0;
02045                         } else {
02046                             result[29] = ulpinv;
02047                             goto L280;
02048                         }
02049                     }
02050 
02051 /*           Do Tests 29 and 30 */
02052 
02053 
02054 /*           Call CSTEMR to compute D2, do tests. */
02055 
02056 /*           Compute D2 */
02057 
02058                     scopy_(&n, &sd[1], &c__1, &d5[1], &c__1);
02059                     if (n > 0) {
02060                         i__3 = n - 1;
02061                         scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
02062                     }
02063 
02064                     ntest = 31;
02065                     i__3 = *lrwork - n;
02066                     i__4 = *liwork - (n << 1);
02067                     cstemr_("N", "I", &n, &d5[1], &rwork[1], &vl, &vu, &il, &
02068                             iu, &m, &d2[1], &z__[z_offset], ldu, &n, &iwork[1]
02069 , &tryrac, &rwork[n + 1], &i__3, &iwork[(n << 1) 
02070                             + 1], &i__4, &iinfo);
02071                     if (iinfo != 0) {
02072                         io___84.ciunit = *nounit;
02073                         s_wsfe(&io___84);
02074                         do_fio(&c__1, "CSTEMR(N,I)", (ftnlen)11);
02075                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
02076                                 ;
02077                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02078                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
02079                                 ;
02080                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
02081                                 integer));
02082                         e_wsfe();
02083                         *info = abs(iinfo);
02084                         if (iinfo < 0) {
02085                             return 0;
02086                         } else {
02087                             result[31] = ulpinv;
02088                             goto L280;
02089                         }
02090                     }
02091 
02092 /*           Do Test 31 */
02093 
02094                     temp1 = 0.f;
02095                     temp2 = 0.f;
02096 
02097                     i__3 = iu - il + 1;
02098                     for (j = 1; j <= i__3; ++j) {
02099 /* Computing MAX */
02100                         r__3 = temp1, r__4 = (r__1 = d1[j], dabs(r__1)), r__3 
02101                                 = max(r__3,r__4), r__4 = (r__2 = d2[j], dabs(
02102                                 r__2));
02103                         temp1 = dmax(r__3,r__4);
02104 /* Computing MAX */
02105                         r__2 = temp2, r__3 = (r__1 = d1[j] - d2[j], dabs(r__1)
02106                                 );
02107                         temp2 = dmax(r__2,r__3);
02108 /* L240: */
02109                     }
02110 
02111 /* Computing MAX */
02112                     r__1 = unfl, r__2 = ulp * dmax(temp1,temp2);
02113                     result[31] = temp2 / dmax(r__1,r__2);
02114 
02115 
02116 /*           Call CSTEMR(V,V) to compute D1 and Z, do tests. */
02117 
02118 /*           Compute D1 and Z */
02119 
02120                     scopy_(&n, &sd[1], &c__1, &d5[1], &c__1);
02121                     if (n > 0) {
02122                         i__3 = n - 1;
02123                         scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
02124                     }
02125                     claset_("Full", &n, &n, &c_b1, &c_b2, &z__[z_offset], ldu);
02126 
02127                     ntest = 32;
02128 
02129                     if (n > 0) {
02130                         if (il != 1) {
02131 /* Computing MAX */
02132                             r__1 = (d2[il] - d2[il - 1]) * .5f, r__2 = ulp * 
02133                                     anorm, r__1 = max(r__1,r__2), r__2 = 
02134                                     rtunfl * 2.f;
02135                             vl = d2[il] - dmax(r__1,r__2);
02136                         } else {
02137 /* Computing MAX */
02138                             r__1 = (d2[n] - d2[1]) * .5f, r__2 = ulp * anorm, 
02139                                     r__1 = max(r__1,r__2), r__2 = rtunfl * 
02140                                     2.f;
02141                             vl = d2[1] - dmax(r__1,r__2);
02142                         }
02143                         if (iu != n) {
02144 /* Computing MAX */
02145                             r__1 = (d2[iu + 1] - d2[iu]) * .5f, r__2 = ulp * 
02146                                     anorm, r__1 = max(r__1,r__2), r__2 = 
02147                                     rtunfl * 2.f;
02148                             vu = d2[iu] + dmax(r__1,r__2);
02149                         } else {
02150 /* Computing MAX */
02151                             r__1 = (d2[n] - d2[1]) * .5f, r__2 = ulp * anorm, 
02152                                     r__1 = max(r__1,r__2), r__2 = rtunfl * 
02153                                     2.f;
02154                             vu = d2[n] + dmax(r__1,r__2);
02155                         }
02156                     } else {
02157                         vl = 0.f;
02158                         vu = 1.f;
02159                     }
02160 
02161                     i__3 = *lrwork - n;
02162                     i__4 = *liwork - (n << 1);
02163                     cstemr_("V", "V", &n, &d5[1], &rwork[1], &vl, &vu, &il, &
02164                             iu, &m, &d1[1], &z__[z_offset], ldu, &n, &iwork[1]
02165 , &tryrac, &rwork[n + 1], &i__3, &iwork[(n << 1) 
02166                             + 1], &i__4, &iinfo);
02167                     if (iinfo != 0) {
02168                         io___85.ciunit = *nounit;
02169                         s_wsfe(&io___85);
02170                         do_fio(&c__1, "CSTEMR(V,V)", (ftnlen)11);
02171                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
02172                                 ;
02173                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02174                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
02175                                 ;
02176                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
02177                                 integer));
02178                         e_wsfe();
02179                         *info = abs(iinfo);
02180                         if (iinfo < 0) {
02181                             return 0;
02182                         } else {
02183                             result[32] = ulpinv;
02184                             goto L280;
02185                         }
02186                     }
02187 
02188 /*           Do Tests 32 and 33 */
02189 
02190                     cstt22_(&n, &m, &c__0, &sd[1], &se[1], &d1[1], dumma, &
02191                             z__[z_offset], ldu, &work[1], &m, &rwork[1], &
02192                             result[32]);
02193 
02194 /*           Call CSTEMR to compute D2, do tests. */
02195 
02196 /*           Compute D2 */
02197 
02198                     scopy_(&n, &sd[1], &c__1, &d5[1], &c__1);
02199                     if (n > 0) {
02200                         i__3 = n - 1;
02201                         scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
02202                     }
02203 
02204                     ntest = 34;
02205                     i__3 = *lrwork - n;
02206                     i__4 = *liwork - (n << 1);
02207                     cstemr_("N", "V", &n, &d5[1], &rwork[1], &vl, &vu, &il, &
02208                             iu, &m, &d2[1], &z__[z_offset], ldu, &n, &iwork[1]
02209 , &tryrac, &rwork[n + 1], &i__3, &iwork[(n << 1) 
02210                             + 1], &i__4, &iinfo);
02211                     if (iinfo != 0) {
02212                         io___86.ciunit = *nounit;
02213                         s_wsfe(&io___86);
02214                         do_fio(&c__1, "CSTEMR(N,V)", (ftnlen)11);
02215                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
02216                                 ;
02217                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02218                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
02219                                 ;
02220                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
02221                                 integer));
02222                         e_wsfe();
02223                         *info = abs(iinfo);
02224                         if (iinfo < 0) {
02225                             return 0;
02226                         } else {
02227                             result[34] = ulpinv;
02228                             goto L280;
02229                         }
02230                     }
02231 
02232 /*           Do Test 34 */
02233 
02234                     temp1 = 0.f;
02235                     temp2 = 0.f;
02236 
02237                     i__3 = iu - il + 1;
02238                     for (j = 1; j <= i__3; ++j) {
02239 /* Computing MAX */
02240                         r__3 = temp1, r__4 = (r__1 = d1[j], dabs(r__1)), r__3 
02241                                 = max(r__3,r__4), r__4 = (r__2 = d2[j], dabs(
02242                                 r__2));
02243                         temp1 = dmax(r__3,r__4);
02244 /* Computing MAX */
02245                         r__2 = temp2, r__3 = (r__1 = d1[j] - d2[j], dabs(r__1)
02246                                 );
02247                         temp2 = dmax(r__2,r__3);
02248 /* L250: */
02249                     }
02250 
02251 /* Computing MAX */
02252                     r__1 = unfl, r__2 = ulp * dmax(temp1,temp2);
02253                     result[34] = temp2 / dmax(r__1,r__2);
02254                 } else {
02255                     result[29] = 0.f;
02256                     result[30] = 0.f;
02257                     result[31] = 0.f;
02258                     result[32] = 0.f;
02259                     result[33] = 0.f;
02260                     result[34] = 0.f;
02261                 }
02262 
02263 
02264 /*           Call CSTEMR(V,A) to compute D1 and Z, do tests. */
02265 
02266 /*           Compute D1 and Z */
02267 
02268                 scopy_(&n, &sd[1], &c__1, &d5[1], &c__1);
02269                 if (n > 0) {
02270                     i__3 = n - 1;
02271                     scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
02272                 }
02273 
02274                 ntest = 35;
02275 
02276                 i__3 = *lrwork - n;
02277                 i__4 = *liwork - (n << 1);
02278                 cstemr_("V", "A", &n, &d5[1], &rwork[1], &vl, &vu, &il, &iu, &
02279                         m, &d1[1], &z__[z_offset], ldu, &n, &iwork[1], &
02280                         tryrac, &rwork[n + 1], &i__3, &iwork[(n << 1) + 1], &
02281                         i__4, &iinfo);
02282                 if (iinfo != 0) {
02283                     io___87.ciunit = *nounit;
02284                     s_wsfe(&io___87);
02285                     do_fio(&c__1, "CSTEMR(V,A)", (ftnlen)11);
02286                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02287                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02288                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02289                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02290                             ;
02291                     e_wsfe();
02292                     *info = abs(iinfo);
02293                     if (iinfo < 0) {
02294                         return 0;
02295                     } else {
02296                         result[35] = ulpinv;
02297                         goto L280;
02298                     }
02299                 }
02300 
02301 /*           Do Tests 35 and 36 */
02302 
02303                 cstt22_(&n, &m, &c__0, &sd[1], &se[1], &d1[1], dumma, &z__[
02304                         z_offset], ldu, &work[1], &m, &rwork[1], &result[35]);
02305 
02306 /*           Call CSTEMR to compute D2, do tests. */
02307 
02308 /*           Compute D2 */
02309 
02310                 scopy_(&n, &sd[1], &c__1, &d5[1], &c__1);
02311                 if (n > 0) {
02312                     i__3 = n - 1;
02313                     scopy_(&i__3, &se[1], &c__1, &rwork[1], &c__1);
02314                 }
02315 
02316                 ntest = 37;
02317                 i__3 = *lrwork - n;
02318                 i__4 = *liwork - (n << 1);
02319                 cstemr_("N", "A", &n, &d5[1], &rwork[1], &vl, &vu, &il, &iu, &
02320                         m, &d2[1], &z__[z_offset], ldu, &n, &iwork[1], &
02321                         tryrac, &rwork[n + 1], &i__3, &iwork[(n << 1) + 1], &
02322                         i__4, &iinfo);
02323                 if (iinfo != 0) {
02324                     io___88.ciunit = *nounit;
02325                     s_wsfe(&io___88);
02326                     do_fio(&c__1, "CSTEMR(N,A)", (ftnlen)11);
02327                     do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02328                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02329                     do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02330                     do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02331                             ;
02332                     e_wsfe();
02333                     *info = abs(iinfo);
02334                     if (iinfo < 0) {
02335                         return 0;
02336                     } else {
02337                         result[37] = ulpinv;
02338                         goto L280;
02339                     }
02340                 }
02341 
02342 /*           Do Test 34 */
02343 
02344                 temp1 = 0.f;
02345                 temp2 = 0.f;
02346 
02347                 i__3 = n;
02348                 for (j = 1; j <= i__3; ++j) {
02349 /* Computing MAX */
02350                     r__3 = temp1, r__4 = (r__1 = d1[j], dabs(r__1)), r__3 = 
02351                             max(r__3,r__4), r__4 = (r__2 = d2[j], dabs(r__2));
02352                     temp1 = dmax(r__3,r__4);
02353 /* Computing MAX */
02354                     r__2 = temp2, r__3 = (r__1 = d1[j] - d2[j], dabs(r__1));
02355                     temp2 = dmax(r__2,r__3);
02356 /* L260: */
02357                 }
02358 
02359 /* Computing MAX */
02360                 r__1 = unfl, r__2 = ulp * dmax(temp1,temp2);
02361                 result[37] = temp2 / dmax(r__1,r__2);
02362             }
02363 L270:
02364 L280:
02365             ntestt += ntest;
02366 
02367 /*           End of Loop -- Check for RESULT(j) > THRESH */
02368 
02369 
02370 /*           Print out tests which fail. */
02371 
02372             i__3 = ntest;
02373             for (jr = 1; jr <= i__3; ++jr) {
02374                 if (result[jr] >= *thresh) {
02375 
02376 /*                 If this is the first test to fail, */
02377 /*                 print a header to the data file. */
02378 
02379                     if (nerrs == 0) {
02380                         io___89.ciunit = *nounit;
02381                         s_wsfe(&io___89);
02382                         do_fio(&c__1, "CST", (ftnlen)3);
02383                         e_wsfe();
02384                         io___90.ciunit = *nounit;
02385                         s_wsfe(&io___90);
02386                         e_wsfe();
02387                         io___91.ciunit = *nounit;
02388                         s_wsfe(&io___91);
02389                         e_wsfe();
02390                         io___92.ciunit = *nounit;
02391                         s_wsfe(&io___92);
02392                         do_fio(&c__1, "Hermitian", (ftnlen)9);
02393                         e_wsfe();
02394                         io___93.ciunit = *nounit;
02395                         s_wsfe(&io___93);
02396                         e_wsfe();
02397 
02398 /*                    Tests performed */
02399 
02400                         io___94.ciunit = *nounit;
02401                         s_wsfe(&io___94);
02402                         e_wsfe();
02403                     }
02404                     ++nerrs;
02405                     if (result[jr] < 1e4f) {
02406                         io___95.ciunit = *nounit;
02407                         s_wsfe(&io___95);
02408                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02409                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
02410                                 ;
02411                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
02412                                 integer));
02413                         do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
02414                         do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
02415                                 real));
02416                         e_wsfe();
02417                     } else {
02418                         io___96.ciunit = *nounit;
02419                         s_wsfe(&io___96);
02420                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02421                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
02422                                 ;
02423                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
02424                                 integer));
02425                         do_fio(&c__1, (char *)&jr, (ftnlen)sizeof(integer));
02426                         do_fio(&c__1, (char *)&result[jr], (ftnlen)sizeof(
02427                                 real));
02428                         e_wsfe();
02429                     }
02430                 }
02431 /* L290: */
02432             }
02433 L300:
02434             ;
02435         }
02436 /* L310: */
02437     }
02438 
02439 /*     Summary */
02440 
02441     slasum_("CST", nounit, &nerrs, &ntestt);
02442     return 0;
02443 
02444 
02445 
02446 
02447 /* L9993: */
02448 /* L9992: */
02449 /* L9991: */
02450 /* L9990: */
02451 
02452 /*     End of CCHKST */
02453 
02454 } /* cchkst_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:19