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


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