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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:20