ddrvsg.c
Go to the documentation of this file.
00001 /* ddrvsg.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 doublereal c_b18 = 0.;
00019 static integer c__0 = 0;
00020 static integer c__6 = 6;
00021 static doublereal c_b35 = 1.;
00022 static integer c__1 = 1;
00023 static integer c__4 = 4;
00024 static integer c__5 = 5;
00025 static doublereal c_b82 = 10.;
00026 static integer c__3 = 3;
00027 
00028 /* Subroutine */ int ddrvsg_(integer *nsizes, integer *nn, integer *ntypes, 
00029         logical *dotype, integer *iseed, doublereal *thresh, integer *nounit, 
00030         doublereal *a, integer *lda, doublereal *b, integer *ldb, doublereal *
00031         d__, doublereal *z__, integer *ldz, doublereal *ab, doublereal *bb, 
00032         doublereal *ap, doublereal *bp, doublereal *work, integer *nwork, 
00033         integer *iwork, integer *liwork, doublereal *result, integer *info)
00034 {
00035     /* Initialized data */
00036 
00037     static integer ktype[21] = { 1,2,4,4,4,4,4,5,5,5,5,5,8,8,8,9,9,9,9,9,9 };
00038     static integer kmagn[21] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3,1,1,1,1,1,1 };
00039     static integer kmode[21] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0,4,4,4,4,4,4 };
00040 
00041     /* Format strings */
00042     static char fmt_9999[] = "(\002 DDRVSG: \002,a,\002 returned INFO=\002,i"
00043             "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00044             "(\002,3(i5,\002,\002),i5,\002)\002)";
00045 
00046     /* System generated locals */
00047     address a__1[3];
00048     integer a_dim1, a_offset, ab_dim1, ab_offset, b_dim1, b_offset, bb_dim1, 
00049             bb_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6[3]
00050             , i__7;
00051     char ch__1[10], ch__2[11], ch__3[12], ch__4[13];
00052 
00053     /* Builtin functions */
00054     double sqrt(doublereal);
00055     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00056     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
00057 
00058     /* Local variables */
00059     integer i__, j, m, n, ka, kb, ij, il, iu;
00060     doublereal vl, vu;
00061     integer ka9, kb9;
00062     doublereal ulp, cond;
00063     integer jcol, nmax;
00064     doublereal unfl, ovfl;
00065     char uplo[1];
00066     logical badnn;
00067     integer imode;
00068     extern logical lsame_(char *, char *);
00069     extern /* Subroutine */ int dsgt01_(integer *, char *, integer *, integer 
00070             *, doublereal *, integer *, doublereal *, integer *, doublereal *, 
00071              integer *, doublereal *, doublereal *, doublereal *);
00072     integer iinfo;
00073     extern /* Subroutine */ int dsbgv_(char *, char *, integer *, integer *, 
00074             integer *, doublereal *, integer *, doublereal *, integer *, 
00075             doublereal *, doublereal *, integer *, doublereal *, integer *);
00076     doublereal aninv, anorm;
00077     integer itemp, nmats;
00078     extern /* Subroutine */ int dspgv_(integer *, char *, char *, integer *, 
00079             doublereal *, doublereal *, doublereal *, doublereal *, integer *, 
00080              doublereal *, integer *);
00081     integer jsize, nerrs, itype, jtype, ntest;
00082     extern /* Subroutine */ int dsygv_(integer *, char *, char *, integer *, 
00083             doublereal *, integer *, doublereal *, integer *, doublereal *, 
00084             doublereal *, integer *, integer *);
00085     integer iseed2[4];
00086     extern /* Subroutine */ int dlabad_(doublereal *, doublereal *);
00087     extern doublereal dlamch_(char *), dlarnd_(integer *, integer *);
00088     extern /* Subroutine */ int dsbgvd_(char *, char *, integer *, integer *, 
00089             integer *, doublereal *, integer *, doublereal *, integer *, 
00090             doublereal *, doublereal *, integer *, doublereal *, integer *, 
00091             integer *, integer *, integer *);
00092     integer idumma[1];
00093     extern /* Subroutine */ int dlacpy_(char *, integer *, integer *, 
00094             doublereal *, integer *, doublereal *, integer *);
00095     integer ioldsd[4];
00096     extern /* Subroutine */ int dlafts_(char *, integer *, integer *, integer 
00097             *, integer *, doublereal *, integer *, doublereal *, integer *, 
00098             integer *), dlaset_(char *, integer *, integer *, 
00099             doublereal *, doublereal *, doublereal *, integer *), 
00100             xerbla_(char *, integer *), dlatmr_(integer *, integer *, 
00101             char *, integer *, char *, doublereal *, integer *, doublereal *, 
00102             doublereal *, char *, char *, doublereal *, integer *, doublereal 
00103             *, doublereal *, integer *, doublereal *, char *, integer *, 
00104             integer *, integer *, doublereal *, doublereal *, char *, 
00105             doublereal *, integer *, integer *, integer *);
00106     doublereal abstol;
00107     extern /* Subroutine */ int dlasum_(char *, integer *, integer *, integer 
00108             *), dlatms_(integer *, integer *, char *, integer *, char 
00109             *, doublereal *, integer *, doublereal *, doublereal *, integer *, 
00110              integer *, char *, doublereal *, integer *, doublereal *, 
00111             integer *), dspgvd_(integer *, char *, 
00112             char *, integer *, doublereal *, doublereal *, doublereal *, 
00113             doublereal *, integer *, doublereal *, integer *, integer *, 
00114             integer *, integer *);
00115     integer ibuplo, ibtype;
00116     extern /* Subroutine */ int dsbgvx_(char *, char *, char *, integer *, 
00117             integer *, integer *, doublereal *, integer *, doublereal *, 
00118             integer *, doublereal *, integer *, doublereal *, doublereal *, 
00119             integer *, integer *, doublereal *, integer *, doublereal *, 
00120             doublereal *, integer *, doublereal *, integer *, integer *, 
00121             integer *), dsygvd_(integer *, char *, 
00122             char *, integer *, doublereal *, integer *, doublereal *, integer 
00123             *, doublereal *, doublereal *, integer *, integer *, integer *, 
00124             integer *);
00125     doublereal rtunfl, rtovfl, ulpinv;
00126     extern /* Subroutine */ int dspgvx_(integer *, char *, char *, char *, 
00127             integer *, doublereal *, doublereal *, doublereal *, doublereal *, 
00128              integer *, integer *, doublereal *, integer *, doublereal *, 
00129             doublereal *, integer *, doublereal *, integer *, integer *, 
00130             integer *);
00131     integer mtypes, ntestt;
00132     extern /* Subroutine */ int dsygvx_(integer *, char *, char *, char *, 
00133             integer *, doublereal *, integer *, doublereal *, integer *, 
00134             doublereal *, doublereal *, integer *, integer *, doublereal *, 
00135             integer *, doublereal *, doublereal *, integer *, doublereal *, 
00136             integer *, integer *, integer *, integer *);
00137 
00138     /* Fortran I/O blocks */
00139     static cilist io___36 = { 0, 0, 0, fmt_9999, 0 };
00140     static cilist io___44 = { 0, 0, 0, fmt_9999, 0 };
00141     static cilist io___45 = { 0, 0, 0, fmt_9999, 0 };
00142     static cilist io___49 = { 0, 0, 0, fmt_9999, 0 };
00143     static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00144     static cilist io___51 = { 0, 0, 0, fmt_9999, 0 };
00145     static cilist io___53 = { 0, 0, 0, fmt_9999, 0 };
00146     static cilist io___54 = { 0, 0, 0, fmt_9999, 0 };
00147     static cilist io___55 = { 0, 0, 0, fmt_9999, 0 };
00148     static cilist io___56 = { 0, 0, 0, fmt_9999, 0 };
00149     static cilist io___57 = { 0, 0, 0, fmt_9999, 0 };
00150     static cilist io___58 = { 0, 0, 0, fmt_9999, 0 };
00151     static cilist io___59 = { 0, 0, 0, fmt_9999, 0 };
00152     static cilist io___60 = { 0, 0, 0, fmt_9999, 0 };
00153     static cilist io___61 = { 0, 0, 0, fmt_9999, 0 };
00154     static cilist io___62 = { 0, 0, 0, fmt_9999, 0 };
00155 
00156 
00157 
00158 /*  -- LAPACK test routine (version 3.1) -- */
00159 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00160 /*     November 2006 */
00161 
00162 /* ****************************************************************** */
00163 
00164 /*     modified August 1997, a new parameter LIWORK is added */
00165 /*     in the calling sequence. */
00166 
00167 /*     test routine DDGT01 is also modified */
00168 
00169 /* ****************************************************************** */
00170 
00171 /*     .. Scalar Arguments .. */
00172 /*     .. */
00173 /*     .. Array Arguments .. */
00174 /*     .. */
00175 
00176 /*  Purpose */
00177 /*  ======= */
00178 
00179 /*       DDRVSG checks the real symmetric generalized eigenproblem */
00180 /*       drivers. */
00181 
00182 /*               DSYGV computes all eigenvalues and, optionally, */
00183 /*               eigenvectors of a real symmetric-definite generalized */
00184 /*               eigenproblem. */
00185 
00186 /*               DSYGVD computes all eigenvalues and, optionally, */
00187 /*               eigenvectors of a real symmetric-definite generalized */
00188 /*               eigenproblem using a divide and conquer algorithm. */
00189 
00190 /*               DSYGVX computes selected eigenvalues and, optionally, */
00191 /*               eigenvectors of a real symmetric-definite generalized */
00192 /*               eigenproblem. */
00193 
00194 /*               DSPGV computes all eigenvalues and, optionally, */
00195 /*               eigenvectors of a real symmetric-definite generalized */
00196 /*               eigenproblem in packed storage. */
00197 
00198 /*               DSPGVD computes all eigenvalues and, optionally, */
00199 /*               eigenvectors of a real symmetric-definite generalized */
00200 /*               eigenproblem in packed storage using a divide and */
00201 /*               conquer algorithm. */
00202 
00203 /*               DSPGVX computes selected eigenvalues and, optionally, */
00204 /*               eigenvectors of a real symmetric-definite generalized */
00205 /*               eigenproblem in packed storage. */
00206 
00207 /*               DSBGV computes all eigenvalues and, optionally, */
00208 /*               eigenvectors of a real symmetric-definite banded */
00209 /*               generalized eigenproblem. */
00210 
00211 /*               DSBGVD computes all eigenvalues and, optionally, */
00212 /*               eigenvectors of a real symmetric-definite banded */
00213 /*               generalized eigenproblem using a divide and conquer */
00214 /*               algorithm. */
00215 
00216 /*               DSBGVX computes selected eigenvalues and, optionally, */
00217 /*               eigenvectors of a real symmetric-definite banded */
00218 /*               generalized eigenproblem. */
00219 
00220 /*       When DDRVSG is called, a number of matrix "sizes" ("n's") and a */
00221 /*       number of matrix "types" are specified.  For each size ("n") */
00222 /*       and each type of matrix, one matrix A of the given type will be */
00223 /*       generated; a random well-conditioned matrix B is also generated */
00224 /*       and the pair (A,B) is used to test the drivers. */
00225 
00226 /*       For each pair (A,B), the following tests are performed: */
00227 
00228 /*       (1) DSYGV with ITYPE = 1 and UPLO ='U': */
00229 
00230 /*               | A Z - B Z D | / ( |A| |Z| n ulp ) */
00231 
00232 /*       (2) as (1) but calling DSPGV */
00233 /*       (3) as (1) but calling DSBGV */
00234 /*       (4) as (1) but with UPLO = 'L' */
00235 /*       (5) as (4) but calling DSPGV */
00236 /*       (6) as (4) but calling DSBGV */
00237 
00238 /*       (7) DSYGV with ITYPE = 2 and UPLO ='U': */
00239 
00240 /*               | A B Z - Z D | / ( |A| |Z| n ulp ) */
00241 
00242 /*       (8) as (7) but calling DSPGV */
00243 /*       (9) as (7) but with UPLO = 'L' */
00244 /*       (10) as (9) but calling DSPGV */
00245 
00246 /*       (11) DSYGV with ITYPE = 3 and UPLO ='U': */
00247 
00248 /*               | B A Z - Z D | / ( |A| |Z| n ulp ) */
00249 
00250 /*       (12) as (11) but calling DSPGV */
00251 /*       (13) as (11) but with UPLO = 'L' */
00252 /*       (14) as (13) but calling DSPGV */
00253 
00254 /*       DSYGVD, DSPGVD and DSBGVD performed the same 14 tests. */
00255 
00256 /*       DSYGVX, DSPGVX and DSBGVX performed the above 14 tests with */
00257 /*       the parameter RANGE = 'A', 'N' and 'I', respectively. */
00258 
00259 /*       The "sizes" are specified by an array NN(1:NSIZES); the value */
00260 /*       of each element NN(j) specifies one size. */
00261 /*       The "types" are specified by a logical array DOTYPE( 1:NTYPES ); */
00262 /*       if DOTYPE(j) is .TRUE., then matrix type "j" will be generated. */
00263 /*       This type is used for the matrix A which has half-bandwidth KA. */
00264 /*       B is generated as a well-conditioned positive definite matrix */
00265 /*       with half-bandwidth KB (<= KA). */
00266 /*       Currently, the list of possible types for A is: */
00267 
00268 /*       (1)  The zero matrix. */
00269 /*       (2)  The identity matrix. */
00270 
00271 /*       (3)  A diagonal matrix with evenly spaced entries */
00272 /*            1, ..., ULP  and random signs. */
00273 /*            (ULP = (first number larger than 1) - 1 ) */
00274 /*       (4)  A diagonal matrix with geometrically spaced entries */
00275 /*            1, ..., ULP  and random signs. */
00276 /*       (5)  A diagonal matrix with "clustered" entries */
00277 /*            1, ULP, ..., ULP and random signs. */
00278 
00279 /*       (6)  Same as (4), but multiplied by SQRT( overflow threshold ) */
00280 /*       (7)  Same as (4), but multiplied by SQRT( underflow threshold ) */
00281 
00282 /*       (8)  A matrix of the form  U* D U, where U is orthogonal and */
00283 /*            D has evenly spaced entries 1, ..., ULP with random signs */
00284 /*            on the diagonal. */
00285 
00286 /*       (9)  A matrix of the form  U* D U, where U is orthogonal and */
00287 /*            D has geometrically spaced entries 1, ..., ULP with random */
00288 /*            signs on the diagonal. */
00289 
00290 /*       (10) A matrix of the form  U* D U, where U is orthogonal and */
00291 /*            D has "clustered" entries 1, ULP,..., ULP with random */
00292 /*            signs on the diagonal. */
00293 
00294 /*       (11) Same as (8), but multiplied by SQRT( overflow threshold ) */
00295 /*       (12) Same as (8), but multiplied by SQRT( underflow threshold ) */
00296 
00297 /*       (13) symmetric matrix with random entries chosen from (-1,1). */
00298 /*       (14) Same as (13), but multiplied by SQRT( overflow threshold ) */
00299 /*       (15) Same as (13), but multiplied by SQRT( underflow threshold) */
00300 
00301 /*       (16) Same as (8), but with KA = 1 and KB = 1 */
00302 /*       (17) Same as (8), but with KA = 2 and KB = 1 */
00303 /*       (18) Same as (8), but with KA = 2 and KB = 2 */
00304 /*       (19) Same as (8), but with KA = 3 and KB = 1 */
00305 /*       (20) Same as (8), but with KA = 3 and KB = 2 */
00306 /*       (21) Same as (8), but with KA = 3 and KB = 3 */
00307 
00308 /*  Arguments */
00309 /*  ========= */
00310 
00311 /*  NSIZES  INTEGER */
00312 /*          The number of sizes of matrices to use.  If it is zero, */
00313 /*          DDRVSG does nothing.  It must be at least zero. */
00314 /*          Not modified. */
00315 
00316 /*  NN      INTEGER array, dimension (NSIZES) */
00317 /*          An array containing the sizes to be used for the matrices. */
00318 /*          Zero values will be skipped.  The values must be at least */
00319 /*          zero. */
00320 /*          Not modified. */
00321 
00322 /*  NTYPES  INTEGER */
00323 /*          The number of elements in DOTYPE.   If it is zero, DDRVSG */
00324 /*          does nothing.  It must be at least zero.  If it is MAXTYP+1 */
00325 /*          and NSIZES is 1, then an additional type, MAXTYP+1 is */
00326 /*          defined, which is to use whatever matrix is in A.  This */
00327 /*          is only useful if DOTYPE(1:MAXTYP) is .FALSE. and */
00328 /*          DOTYPE(MAXTYP+1) is .TRUE. . */
00329 /*          Not modified. */
00330 
00331 /*  DOTYPE  LOGICAL array, dimension (NTYPES) */
00332 /*          If DOTYPE(j) is .TRUE., then for each size in NN a */
00333 /*          matrix of that size and of type j will be generated. */
00334 /*          If NTYPES is smaller than the maximum number of types */
00335 /*          defined (PARAMETER MAXTYP), then types NTYPES+1 through */
00336 /*          MAXTYP will not be generated.  If NTYPES is larger */
00337 /*          than MAXTYP, DOTYPE(MAXTYP+1) through DOTYPE(NTYPES) */
00338 /*          will be ignored. */
00339 /*          Not modified. */
00340 
00341 /*  ISEED   INTEGER array, dimension (4) */
00342 /*          On entry ISEED specifies the seed of the random number */
00343 /*          generator. The array elements should be between 0 and 4095; */
00344 /*          if not they will be reduced mod 4096.  Also, ISEED(4) must */
00345 /*          be odd.  The random number generator uses a linear */
00346 /*          congruential sequence limited to small integers, and so */
00347 /*          should produce machine independent random numbers. The */
00348 /*          values of ISEED are changed on exit, and can be used in the */
00349 /*          next call to DDRVSG to continue the same random number */
00350 /*          sequence. */
00351 /*          Modified. */
00352 
00353 /*  THRESH  DOUBLE PRECISION */
00354 /*          A test will count as "failed" if the "error", computed as */
00355 /*          described above, exceeds THRESH.  Note that the error */
00356 /*          is scaled to be O(1), so THRESH should be a reasonably */
00357 /*          small multiple of 1, e.g., 10 or 100.  In particular, */
00358 /*          it should not depend on the precision (single vs. double) */
00359 /*          or the size of the matrix.  It must be at least zero. */
00360 /*          Not modified. */
00361 
00362 /*  NOUNIT  INTEGER */
00363 /*          The FORTRAN unit number for printing out error messages */
00364 /*          (e.g., if a routine returns IINFO not equal to 0.) */
00365 /*          Not modified. */
00366 
00367 /*  A       DOUBLE PRECISION array, dimension (LDA , max(NN)) */
00368 /*          Used to hold the matrix whose eigenvalues are to be */
00369 /*          computed.  On exit, A contains the last matrix actually */
00370 /*          used. */
00371 /*          Modified. */
00372 
00373 /*  LDA     INTEGER */
00374 /*          The leading dimension of A and AB.  It must be at */
00375 /*          least 1 and at least max( NN ). */
00376 /*          Not modified. */
00377 
00378 /*  B       DOUBLE PRECISION array, dimension (LDB , max(NN)) */
00379 /*          Used to hold the symmetric positive definite matrix for */
00380 /*          the generailzed problem. */
00381 /*          On exit, B contains the last matrix actually */
00382 /*          used. */
00383 /*          Modified. */
00384 
00385 /*  LDB     INTEGER */
00386 /*          The leading dimension of B and BB.  It must be at */
00387 /*          least 1 and at least max( NN ). */
00388 /*          Not modified. */
00389 
00390 /*  D       DOUBLE PRECISION array, dimension (max(NN)) */
00391 /*          The eigenvalues of A. On exit, the eigenvalues in D */
00392 /*          correspond with the matrix in A. */
00393 /*          Modified. */
00394 
00395 /*  Z       DOUBLE PRECISION array, dimension (LDZ, max(NN)) */
00396 /*          The matrix of eigenvectors. */
00397 /*          Modified. */
00398 
00399 /*  LDZ     INTEGER */
00400 /*          The leading dimension of Z.  It must be at least 1 and */
00401 /*          at least max( NN ). */
00402 /*          Not modified. */
00403 
00404 /*  AB      DOUBLE PRECISION array, dimension (LDA, max(NN)) */
00405 /*          Workspace. */
00406 /*          Modified. */
00407 
00408 /*  BB      DOUBLE PRECISION array, dimension (LDB, max(NN)) */
00409 /*          Workspace. */
00410 /*          Modified. */
00411 
00412 /*  AP      DOUBLE PRECISION array, dimension (max(NN)**2) */
00413 /*          Workspace. */
00414 /*          Modified. */
00415 
00416 /*  BP      DOUBLE PRECISION array, dimension (max(NN)**2) */
00417 /*          Workspace. */
00418 /*          Modified. */
00419 
00420 /*  WORK    DOUBLE PRECISION array, dimension (NWORK) */
00421 /*          Workspace. */
00422 /*          Modified. */
00423 
00424 /*  NWORK   INTEGER */
00425 /*          The number of entries in WORK.  This must be at least */
00426 /*          1+5*N+2*N*lg(N)+3*N**2 where N = max( NN(j) ) and */
00427 /*          lg( N ) = smallest integer k such that 2**k >= N. */
00428 /*          Not modified. */
00429 
00430 /*  IWORK   INTEGER array, dimension (LIWORK) */
00431 /*          Workspace. */
00432 /*          Modified. */
00433 
00434 /*  LIWORK  INTEGER */
00435 /*          The number of entries in WORK.  This must be at least 6*N. */
00436 /*          Not modified. */
00437 
00438 /*  RESULT  DOUBLE PRECISION array, dimension (70) */
00439 /*          The values computed by the 70 tests described above. */
00440 /*          Modified. */
00441 
00442 /*  INFO    INTEGER */
00443 /*          If 0, then everything ran OK. */
00444 /*           -1: NSIZES < 0 */
00445 /*           -2: Some NN(j) < 0 */
00446 /*           -3: NTYPES < 0 */
00447 /*           -5: THRESH < 0 */
00448 /*           -9: LDA < 1 or LDA < NMAX, where NMAX is max( NN(j) ). */
00449 /*          -16: LDZ < 1 or LDZ < NMAX. */
00450 /*          -21: NWORK too small. */
00451 /*          -23: LIWORK too small. */
00452 /*          If  DLATMR, SLATMS, DSYGV, DSPGV, DSBGV, SSYGVD, SSPGVD, */
00453 /*              DSBGVD, DSYGVX, DSPGVX or SSBGVX returns an error code, */
00454 /*              the absolute value of it is returned. */
00455 /*          Modified. */
00456 
00457 /* ---------------------------------------------------------------------- */
00458 
00459 /*       Some Local Variables and Parameters: */
00460 /*       ---- ----- --------- --- ---------- */
00461 /*       ZERO, ONE       Real 0 and 1. */
00462 /*       MAXTYP          The number of types defined. */
00463 /*       NTEST           The number of tests that have been run */
00464 /*                       on this matrix. */
00465 /*       NTESTT          The total number of tests for this call. */
00466 /*       NMAX            Largest value in NN. */
00467 /*       NMATS           The number of matrices generated so far. */
00468 /*       NERRS           The number of tests which have exceeded THRESH */
00469 /*                       so far (computed by DLAFTS). */
00470 /*       COND, IMODE     Values to be passed to the matrix generators. */
00471 /*       ANORM           Norm of A; passed to matrix generators. */
00472 
00473 /*       OVFL, UNFL      Overflow and underflow thresholds. */
00474 /*       ULP, ULPINV     Finest relative precision and its inverse. */
00475 /*       RTOVFL, RTUNFL  Square roots of the previous 2 values. */
00476 /*               The following four arrays decode JTYPE: */
00477 /*       KTYPE(j)        The general type (1-10) for type "j". */
00478 /*       KMODE(j)        The MODE value to be passed to the matrix */
00479 /*                       generator for type "j". */
00480 /*       KMAGN(j)        The order of magnitude ( O(1), */
00481 /*                       O(overflow^(1/2) ), O(underflow^(1/2) ) */
00482 
00483 /*  ===================================================================== */
00484 
00485 /*     .. Parameters .. */
00486 /*     .. */
00487 /*     .. Local Scalars .. */
00488 /*     .. */
00489 /*     .. Local Arrays .. */
00490 /*     .. */
00491 /*     .. External Functions .. */
00492 /*     .. */
00493 /*     .. External Subroutines .. */
00494 /*     .. */
00495 /*     .. Intrinsic Functions .. */
00496 /*     .. */
00497 /*     .. Data statements .. */
00498     /* Parameter adjustments */
00499     --nn;
00500     --dotype;
00501     --iseed;
00502     ab_dim1 = *lda;
00503     ab_offset = 1 + ab_dim1;
00504     ab -= ab_offset;
00505     a_dim1 = *lda;
00506     a_offset = 1 + a_dim1;
00507     a -= a_offset;
00508     bb_dim1 = *ldb;
00509     bb_offset = 1 + bb_dim1;
00510     bb -= bb_offset;
00511     b_dim1 = *ldb;
00512     b_offset = 1 + b_dim1;
00513     b -= b_offset;
00514     --d__;
00515     z_dim1 = *ldz;
00516     z_offset = 1 + z_dim1;
00517     z__ -= z_offset;
00518     --ap;
00519     --bp;
00520     --work;
00521     --iwork;
00522     --result;
00523 
00524     /* Function Body */
00525 /*     .. */
00526 /*     .. Executable Statements .. */
00527 
00528 /*     1)      Check for errors */
00529 
00530     ntestt = 0;
00531     *info = 0;
00532 
00533     badnn = FALSE_;
00534     nmax = 0;
00535     i__1 = *nsizes;
00536     for (j = 1; j <= i__1; ++j) {
00537 /* Computing MAX */
00538         i__2 = nmax, i__3 = nn[j];
00539         nmax = max(i__2,i__3);
00540         if (nn[j] < 0) {
00541             badnn = TRUE_;
00542         }
00543 /* L10: */
00544     }
00545 
00546 /*     Check for errors */
00547 
00548     if (*nsizes < 0) {
00549         *info = -1;
00550     } else if (badnn) {
00551         *info = -2;
00552     } else if (*ntypes < 0) {
00553         *info = -3;
00554     } else if (*lda <= 1 || *lda < nmax) {
00555         *info = -9;
00556     } else if (*ldz <= 1 || *ldz < nmax) {
00557         *info = -16;
00558     } else /* if(complicated condition) */ {
00559 /* Computing 2nd power */
00560         i__1 = max(nmax,3);
00561         if (i__1 * i__1 << 1 > *nwork) {
00562             *info = -21;
00563         } else /* if(complicated condition) */ {
00564 /* Computing 2nd power */
00565             i__1 = max(nmax,3);
00566             if (i__1 * i__1 << 1 > *liwork) {
00567                 *info = -23;
00568             }
00569         }
00570     }
00571 
00572     if (*info != 0) {
00573         i__1 = -(*info);
00574         xerbla_("DDRVSG", &i__1);
00575         return 0;
00576     }
00577 
00578 /*     Quick return if possible */
00579 
00580     if (*nsizes == 0 || *ntypes == 0) {
00581         return 0;
00582     }
00583 
00584 /*     More Important constants */
00585 
00586     unfl = dlamch_("Safe minimum");
00587     ovfl = dlamch_("Overflow");
00588     dlabad_(&unfl, &ovfl);
00589     ulp = dlamch_("Epsilon") * dlamch_("Base");
00590     ulpinv = 1. / ulp;
00591     rtunfl = sqrt(unfl);
00592     rtovfl = sqrt(ovfl);
00593 
00594     for (i__ = 1; i__ <= 4; ++i__) {
00595         iseed2[i__ - 1] = iseed[i__];
00596 /* L20: */
00597     }
00598 
00599 /*     Loop over sizes, types */
00600 
00601     nerrs = 0;
00602     nmats = 0;
00603 
00604     i__1 = *nsizes;
00605     for (jsize = 1; jsize <= i__1; ++jsize) {
00606         n = nn[jsize];
00607         aninv = 1. / (doublereal) max(1,n);
00608 
00609         if (*nsizes != 1) {
00610             mtypes = min(21,*ntypes);
00611         } else {
00612             mtypes = min(22,*ntypes);
00613         }
00614 
00615         ka9 = 0;
00616         kb9 = 0;
00617         i__2 = mtypes;
00618         for (jtype = 1; jtype <= i__2; ++jtype) {
00619             if (! dotype[jtype]) {
00620                 goto L640;
00621             }
00622             ++nmats;
00623             ntest = 0;
00624 
00625             for (j = 1; j <= 4; ++j) {
00626                 ioldsd[j - 1] = iseed[j];
00627 /* L30: */
00628             }
00629 
00630 /*           2)      Compute "A" */
00631 
00632 /*                   Control parameters: */
00633 
00634 /*               KMAGN  KMODE        KTYPE */
00635 /*           =1  O(1)   clustered 1  zero */
00636 /*           =2  large  clustered 2  identity */
00637 /*           =3  small  exponential  (none) */
00638 /*           =4         arithmetic   diagonal, w/ eigenvalues */
00639 /*           =5         random log   hermitian, w/ eigenvalues */
00640 /*           =6         random       (none) */
00641 /*           =7                      random diagonal */
00642 /*           =8                      random hermitian */
00643 /*           =9                      banded, w/ eigenvalues */
00644 
00645             if (mtypes > 21) {
00646                 goto L90;
00647             }
00648 
00649             itype = ktype[jtype - 1];
00650             imode = kmode[jtype - 1];
00651 
00652 /*           Compute norm */
00653 
00654             switch (kmagn[jtype - 1]) {
00655                 case 1:  goto L40;
00656                 case 2:  goto L50;
00657                 case 3:  goto L60;
00658             }
00659 
00660 L40:
00661             anorm = 1.;
00662             goto L70;
00663 
00664 L50:
00665             anorm = rtovfl * ulp * aninv;
00666             goto L70;
00667 
00668 L60:
00669             anorm = rtunfl * n * ulpinv;
00670             goto L70;
00671 
00672 L70:
00673 
00674             iinfo = 0;
00675             cond = ulpinv;
00676 
00677 /*           Special Matrices -- Identity & Jordan block */
00678 
00679             if (itype == 1) {
00680 
00681 /*              Zero */
00682 
00683                 ka = 0;
00684                 kb = 0;
00685                 dlaset_("Full", lda, &n, &c_b18, &c_b18, &a[a_offset], lda);
00686 
00687             } else if (itype == 2) {
00688 
00689 /*              Identity */
00690 
00691                 ka = 0;
00692                 kb = 0;
00693                 dlaset_("Full", lda, &n, &c_b18, &c_b18, &a[a_offset], lda);
00694                 i__3 = n;
00695                 for (jcol = 1; jcol <= i__3; ++jcol) {
00696                     a[jcol + jcol * a_dim1] = anorm;
00697 /* L80: */
00698                 }
00699 
00700             } else if (itype == 4) {
00701 
00702 /*              Diagonal Matrix, [Eigen]values Specified */
00703 
00704                 ka = 0;
00705                 kb = 0;
00706                 dlatms_(&n, &n, "S", &iseed[1], "S", &work[1], &imode, &cond, 
00707                         &anorm, &c__0, &c__0, "N", &a[a_offset], lda, &work[n 
00708                         + 1], &iinfo);
00709 
00710             } else if (itype == 5) {
00711 
00712 /*              symmetric, eigenvalues specified */
00713 
00714 /* Computing MAX */
00715                 i__3 = 0, i__4 = n - 1;
00716                 ka = max(i__3,i__4);
00717                 kb = ka;
00718                 dlatms_(&n, &n, "S", &iseed[1], "S", &work[1], &imode, &cond, 
00719                         &anorm, &n, &n, "N", &a[a_offset], lda, &work[n + 1], 
00720                         &iinfo);
00721 
00722             } else if (itype == 7) {
00723 
00724 /*              Diagonal, random eigenvalues */
00725 
00726                 ka = 0;
00727                 kb = 0;
00728                 dlatmr_(&n, &n, "S", &iseed[1], "S", &work[1], &c__6, &c_b35, 
00729                         &c_b35, "T", "N", &work[n + 1], &c__1, &c_b35, &work[(
00730                         n << 1) + 1], &c__1, &c_b35, "N", idumma, &c__0, &
00731                         c__0, &c_b18, &anorm, "NO", &a[a_offset], lda, &iwork[
00732                         1], &iinfo);
00733 
00734             } else if (itype == 8) {
00735 
00736 /*              symmetric, random eigenvalues */
00737 
00738 /* Computing MAX */
00739                 i__3 = 0, i__4 = n - 1;
00740                 ka = max(i__3,i__4);
00741                 kb = ka;
00742                 dlatmr_(&n, &n, "S", &iseed[1], "H", &work[1], &c__6, &c_b35, 
00743                         &c_b35, "T", "N", &work[n + 1], &c__1, &c_b35, &work[(
00744                         n << 1) + 1], &c__1, &c_b35, "N", idumma, &n, &n, &
00745                         c_b18, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00746                         iinfo);
00747 
00748             } else if (itype == 9) {
00749 
00750 /*              symmetric banded, eigenvalues specified */
00751 
00752 /*              The following values are used for the half-bandwidths: */
00753 
00754 /*                ka = 1   kb = 1 */
00755 /*                ka = 2   kb = 1 */
00756 /*                ka = 2   kb = 2 */
00757 /*                ka = 3   kb = 1 */
00758 /*                ka = 3   kb = 2 */
00759 /*                ka = 3   kb = 3 */
00760 
00761                 ++kb9;
00762                 if (kb9 > ka9) {
00763                     ++ka9;
00764                     kb9 = 1;
00765                 }
00766 /* Computing MAX */
00767 /* Computing MIN */
00768                 i__5 = n - 1;
00769                 i__3 = 0, i__4 = min(i__5,ka9);
00770                 ka = max(i__3,i__4);
00771 /* Computing MAX */
00772 /* Computing MIN */
00773                 i__5 = n - 1;
00774                 i__3 = 0, i__4 = min(i__5,kb9);
00775                 kb = max(i__3,i__4);
00776                 dlatms_(&n, &n, "S", &iseed[1], "S", &work[1], &imode, &cond, 
00777                         &anorm, &ka, &ka, "N", &a[a_offset], lda, &work[n + 1]
00778 , &iinfo);
00779 
00780             } else {
00781 
00782                 iinfo = 1;
00783             }
00784 
00785             if (iinfo != 0) {
00786                 io___36.ciunit = *nounit;
00787                 s_wsfe(&io___36);
00788                 do_fio(&c__1, "Generator", (ftnlen)9);
00789                 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00790                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00791                 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00792                 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00793                 e_wsfe();
00794                 *info = abs(iinfo);
00795                 return 0;
00796             }
00797 
00798 L90:
00799 
00800             abstol = unfl + unfl;
00801             if (n <= 1) {
00802                 il = 1;
00803                 iu = n;
00804             } else {
00805                 il = (integer) ((n - 1) * dlarnd_(&c__1, iseed2) + 1);
00806                 iu = (integer) ((n - 1) * dlarnd_(&c__1, iseed2) + 1);
00807                 if (il > iu) {
00808                     itemp = il;
00809                     il = iu;
00810                     iu = itemp;
00811                 }
00812             }
00813 
00814 /*           3) Call DSYGV, DSPGV, DSBGV, SSYGVD, SSPGVD, SSBGVD, */
00815 /*              DSYGVX, DSPGVX, and DSBGVX, do tests. */
00816 
00817 /*           loop over the three generalized problems */
00818 /*                 IBTYPE = 1: A*x = (lambda)*B*x */
00819 /*                 IBTYPE = 2: A*B*x = (lambda)*x */
00820 /*                 IBTYPE = 3: B*A*x = (lambda)*x */
00821 
00822             for (ibtype = 1; ibtype <= 3; ++ibtype) {
00823 
00824 /*              loop over the setting UPLO */
00825 
00826                 for (ibuplo = 1; ibuplo <= 2; ++ibuplo) {
00827                     if (ibuplo == 1) {
00828                         *(unsigned char *)uplo = 'U';
00829                     }
00830                     if (ibuplo == 2) {
00831                         *(unsigned char *)uplo = 'L';
00832                     }
00833 
00834 /*                 Generate random well-conditioned positive definite */
00835 /*                 matrix B, of bandwidth not greater than that of A. */
00836 
00837                     dlatms_(&n, &n, "U", &iseed[1], "P", &work[1], &c__5, &
00838                             c_b82, &c_b35, &kb, &kb, uplo, &b[b_offset], ldb, 
00839                             &work[n + 1], &iinfo);
00840 
00841 /*                 Test DSYGV */
00842 
00843                     ++ntest;
00844 
00845                     dlacpy_(" ", &n, &n, &a[a_offset], lda, &z__[z_offset], 
00846                             ldz);
00847                     dlacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset], 
00848                             ldb);
00849 
00850                     dsygv_(&ibtype, "V", uplo, &n, &z__[z_offset], ldz, &bb[
00851                             bb_offset], ldb, &d__[1], &work[1], nwork, &iinfo);
00852                     if (iinfo != 0) {
00853                         io___44.ciunit = *nounit;
00854                         s_wsfe(&io___44);
00855 /* Writing concatenation */
00856                         i__6[0] = 8, a__1[0] = "DSYGV(V,";
00857                         i__6[1] = 1, a__1[1] = uplo;
00858                         i__6[2] = 1, a__1[2] = ")";
00859                         s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)10);
00860                         do_fio(&c__1, ch__1, (ftnlen)10);
00861                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00862                                 ;
00863                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00864                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00865                                 ;
00866                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00867                                 integer));
00868                         e_wsfe();
00869                         *info = abs(iinfo);
00870                         if (iinfo < 0) {
00871                             return 0;
00872                         } else {
00873                             result[ntest] = ulpinv;
00874                             goto L100;
00875                         }
00876                     }
00877 
00878 /*                 Do Test */
00879 
00880                     dsgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
00881                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
00882                             work[1], &result[ntest]);
00883 
00884 /*                 Test DSYGVD */
00885 
00886                     ++ntest;
00887 
00888                     dlacpy_(" ", &n, &n, &a[a_offset], lda, &z__[z_offset], 
00889                             ldz);
00890                     dlacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset], 
00891                             ldb);
00892 
00893                     dsygvd_(&ibtype, "V", uplo, &n, &z__[z_offset], ldz, &bb[
00894                             bb_offset], ldb, &d__[1], &work[1], nwork, &iwork[
00895                             1], liwork, &iinfo);
00896                     if (iinfo != 0) {
00897                         io___45.ciunit = *nounit;
00898                         s_wsfe(&io___45);
00899 /* Writing concatenation */
00900                         i__6[0] = 9, a__1[0] = "DSYGVD(V,";
00901                         i__6[1] = 1, a__1[1] = uplo;
00902                         i__6[2] = 1, a__1[2] = ")";
00903                         s_cat(ch__2, a__1, i__6, &c__3, (ftnlen)11);
00904                         do_fio(&c__1, ch__2, (ftnlen)11);
00905                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00906                                 ;
00907                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00908                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00909                                 ;
00910                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00911                                 integer));
00912                         e_wsfe();
00913                         *info = abs(iinfo);
00914                         if (iinfo < 0) {
00915                             return 0;
00916                         } else {
00917                             result[ntest] = ulpinv;
00918                             goto L100;
00919                         }
00920                     }
00921 
00922 /*                 Do Test */
00923 
00924                     dsgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
00925                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
00926                             work[1], &result[ntest]);
00927 
00928 /*                 Test DSYGVX */
00929 
00930                     ++ntest;
00931 
00932                     dlacpy_(" ", &n, &n, &a[a_offset], lda, &ab[ab_offset], 
00933                             lda);
00934                     dlacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset], 
00935                             ldb);
00936 
00937                     dsygvx_(&ibtype, "V", "A", uplo, &n, &ab[ab_offset], lda, 
00938                             &bb[bb_offset], ldb, &vl, &vu, &il, &iu, &abstol, 
00939                             &m, &d__[1], &z__[z_offset], ldz, &work[1], nwork, 
00940                              &iwork[n + 1], &iwork[1], &iinfo);
00941                     if (iinfo != 0) {
00942                         io___49.ciunit = *nounit;
00943                         s_wsfe(&io___49);
00944 /* Writing concatenation */
00945                         i__6[0] = 10, a__1[0] = "DSYGVX(V,A";
00946                         i__6[1] = 1, a__1[1] = uplo;
00947                         i__6[2] = 1, a__1[2] = ")";
00948                         s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
00949                         do_fio(&c__1, ch__3, (ftnlen)12);
00950                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00951                                 ;
00952                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00953                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00954                                 ;
00955                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00956                                 integer));
00957                         e_wsfe();
00958                         *info = abs(iinfo);
00959                         if (iinfo < 0) {
00960                             return 0;
00961                         } else {
00962                             result[ntest] = ulpinv;
00963                             goto L100;
00964                         }
00965                     }
00966 
00967 /*                 Do Test */
00968 
00969                     dsgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
00970                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
00971                             work[1], &result[ntest]);
00972 
00973                     ++ntest;
00974 
00975                     dlacpy_(" ", &n, &n, &a[a_offset], lda, &ab[ab_offset], 
00976                             lda);
00977                     dlacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset], 
00978                             ldb);
00979 
00980 /*                 since we do not know the exact eigenvalues of this */
00981 /*                 eigenpair, we just set VL and VU as constants. */
00982 /*                 It is quite possible that there are no eigenvalues */
00983 /*                 in this interval. */
00984 
00985                     vl = 0.;
00986                     vu = anorm;
00987                     dsygvx_(&ibtype, "V", "V", uplo, &n, &ab[ab_offset], lda, 
00988                             &bb[bb_offset], ldb, &vl, &vu, &il, &iu, &abstol, 
00989                             &m, &d__[1], &z__[z_offset], ldz, &work[1], nwork, 
00990                              &iwork[n + 1], &iwork[1], &iinfo);
00991                     if (iinfo != 0) {
00992                         io___50.ciunit = *nounit;
00993                         s_wsfe(&io___50);
00994 /* Writing concatenation */
00995                         i__6[0] = 11, a__1[0] = "DSYGVX(V,V,";
00996                         i__6[1] = 1, a__1[1] = uplo;
00997                         i__6[2] = 1, a__1[2] = ")";
00998                         s_cat(ch__4, a__1, i__6, &c__3, (ftnlen)13);
00999                         do_fio(&c__1, ch__4, (ftnlen)13);
01000                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01001                                 ;
01002                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01003                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01004                                 ;
01005                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01006                                 integer));
01007                         e_wsfe();
01008                         *info = abs(iinfo);
01009                         if (iinfo < 0) {
01010                             return 0;
01011                         } else {
01012                             result[ntest] = ulpinv;
01013                             goto L100;
01014                         }
01015                     }
01016 
01017 /*                 Do Test */
01018 
01019                     dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01020                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01021                             work[1], &result[ntest]);
01022 
01023                     ++ntest;
01024 
01025                     dlacpy_(" ", &n, &n, &a[a_offset], lda, &ab[ab_offset], 
01026                             lda);
01027                     dlacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset], 
01028                             ldb);
01029 
01030                     dsygvx_(&ibtype, "V", "I", uplo, &n, &ab[ab_offset], lda, 
01031                             &bb[bb_offset], ldb, &vl, &vu, &il, &iu, &abstol, 
01032                             &m, &d__[1], &z__[z_offset], ldz, &work[1], nwork, 
01033                              &iwork[n + 1], &iwork[1], &iinfo);
01034                     if (iinfo != 0) {
01035                         io___51.ciunit = *nounit;
01036                         s_wsfe(&io___51);
01037 /* Writing concatenation */
01038                         i__6[0] = 11, a__1[0] = "DSYGVX(V,I,";
01039                         i__6[1] = 1, a__1[1] = uplo;
01040                         i__6[2] = 1, a__1[2] = ")";
01041                         s_cat(ch__4, a__1, i__6, &c__3, (ftnlen)13);
01042                         do_fio(&c__1, ch__4, (ftnlen)13);
01043                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01044                                 ;
01045                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01046                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01047                                 ;
01048                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01049                                 integer));
01050                         e_wsfe();
01051                         *info = abs(iinfo);
01052                         if (iinfo < 0) {
01053                             return 0;
01054                         } else {
01055                             result[ntest] = ulpinv;
01056                             goto L100;
01057                         }
01058                     }
01059 
01060 /*                 Do Test */
01061 
01062                     dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01063                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01064                             work[1], &result[ntest]);
01065 
01066 L100:
01067 
01068 /*                 Test DSPGV */
01069 
01070                     ++ntest;
01071 
01072 /*                 Copy the matrices into packed storage. */
01073 
01074                     if (lsame_(uplo, "U")) {
01075                         ij = 1;
01076                         i__3 = n;
01077                         for (j = 1; j <= i__3; ++j) {
01078                             i__4 = j;
01079                             for (i__ = 1; i__ <= i__4; ++i__) {
01080                                 ap[ij] = a[i__ + j * a_dim1];
01081                                 bp[ij] = b[i__ + j * b_dim1];
01082                                 ++ij;
01083 /* L110: */
01084                             }
01085 /* L120: */
01086                         }
01087                     } else {
01088                         ij = 1;
01089                         i__3 = n;
01090                         for (j = 1; j <= i__3; ++j) {
01091                             i__4 = n;
01092                             for (i__ = j; i__ <= i__4; ++i__) {
01093                                 ap[ij] = a[i__ + j * a_dim1];
01094                                 bp[ij] = b[i__ + j * b_dim1];
01095                                 ++ij;
01096 /* L130: */
01097                             }
01098 /* L140: */
01099                         }
01100                     }
01101 
01102                     dspgv_(&ibtype, "V", uplo, &n, &ap[1], &bp[1], &d__[1], &
01103                             z__[z_offset], ldz, &work[1], &iinfo);
01104                     if (iinfo != 0) {
01105                         io___53.ciunit = *nounit;
01106                         s_wsfe(&io___53);
01107 /* Writing concatenation */
01108                         i__6[0] = 8, a__1[0] = "DSPGV(V,";
01109                         i__6[1] = 1, a__1[1] = uplo;
01110                         i__6[2] = 1, a__1[2] = ")";
01111                         s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)10);
01112                         do_fio(&c__1, ch__1, (ftnlen)10);
01113                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01114                                 ;
01115                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01116                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01117                                 ;
01118                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01119                                 integer));
01120                         e_wsfe();
01121                         *info = abs(iinfo);
01122                         if (iinfo < 0) {
01123                             return 0;
01124                         } else {
01125                             result[ntest] = ulpinv;
01126                             goto L310;
01127                         }
01128                     }
01129 
01130 /*                 Do Test */
01131 
01132                     dsgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01133                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01134                             work[1], &result[ntest]);
01135 
01136 /*                 Test DSPGVD */
01137 
01138                     ++ntest;
01139 
01140 /*                 Copy the matrices into packed storage. */
01141 
01142                     if (lsame_(uplo, "U")) {
01143                         ij = 1;
01144                         i__3 = n;
01145                         for (j = 1; j <= i__3; ++j) {
01146                             i__4 = j;
01147                             for (i__ = 1; i__ <= i__4; ++i__) {
01148                                 ap[ij] = a[i__ + j * a_dim1];
01149                                 bp[ij] = b[i__ + j * b_dim1];
01150                                 ++ij;
01151 /* L150: */
01152                             }
01153 /* L160: */
01154                         }
01155                     } else {
01156                         ij = 1;
01157                         i__3 = n;
01158                         for (j = 1; j <= i__3; ++j) {
01159                             i__4 = n;
01160                             for (i__ = j; i__ <= i__4; ++i__) {
01161                                 ap[ij] = a[i__ + j * a_dim1];
01162                                 bp[ij] = b[i__ + j * b_dim1];
01163                                 ++ij;
01164 /* L170: */
01165                             }
01166 /* L180: */
01167                         }
01168                     }
01169 
01170                     dspgvd_(&ibtype, "V", uplo, &n, &ap[1], &bp[1], &d__[1], &
01171                             z__[z_offset], ldz, &work[1], nwork, &iwork[1], 
01172                             liwork, &iinfo);
01173                     if (iinfo != 0) {
01174                         io___54.ciunit = *nounit;
01175                         s_wsfe(&io___54);
01176 /* Writing concatenation */
01177                         i__6[0] = 9, a__1[0] = "DSPGVD(V,";
01178                         i__6[1] = 1, a__1[1] = uplo;
01179                         i__6[2] = 1, a__1[2] = ")";
01180                         s_cat(ch__2, a__1, i__6, &c__3, (ftnlen)11);
01181                         do_fio(&c__1, ch__2, (ftnlen)11);
01182                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01183                                 ;
01184                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01185                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01186                                 ;
01187                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01188                                 integer));
01189                         e_wsfe();
01190                         *info = abs(iinfo);
01191                         if (iinfo < 0) {
01192                             return 0;
01193                         } else {
01194                             result[ntest] = ulpinv;
01195                             goto L310;
01196                         }
01197                     }
01198 
01199 /*                 Do Test */
01200 
01201                     dsgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01202                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01203                             work[1], &result[ntest]);
01204 
01205 /*                 Test DSPGVX */
01206 
01207                     ++ntest;
01208 
01209 /*                 Copy the matrices into packed storage. */
01210 
01211                     if (lsame_(uplo, "U")) {
01212                         ij = 1;
01213                         i__3 = n;
01214                         for (j = 1; j <= i__3; ++j) {
01215                             i__4 = j;
01216                             for (i__ = 1; i__ <= i__4; ++i__) {
01217                                 ap[ij] = a[i__ + j * a_dim1];
01218                                 bp[ij] = b[i__ + j * b_dim1];
01219                                 ++ij;
01220 /* L190: */
01221                             }
01222 /* L200: */
01223                         }
01224                     } else {
01225                         ij = 1;
01226                         i__3 = n;
01227                         for (j = 1; j <= i__3; ++j) {
01228                             i__4 = n;
01229                             for (i__ = j; i__ <= i__4; ++i__) {
01230                                 ap[ij] = a[i__ + j * a_dim1];
01231                                 bp[ij] = b[i__ + j * b_dim1];
01232                                 ++ij;
01233 /* L210: */
01234                             }
01235 /* L220: */
01236                         }
01237                     }
01238 
01239                     dspgvx_(&ibtype, "V", "A", uplo, &n, &ap[1], &bp[1], &vl, 
01240                             &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01241                             z_offset], ldz, &work[1], &iwork[n + 1], &iwork[1]
01242 , info);
01243                     if (iinfo != 0) {
01244                         io___55.ciunit = *nounit;
01245                         s_wsfe(&io___55);
01246 /* Writing concatenation */
01247                         i__6[0] = 10, a__1[0] = "DSPGVX(V,A";
01248                         i__6[1] = 1, a__1[1] = uplo;
01249                         i__6[2] = 1, a__1[2] = ")";
01250                         s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01251                         do_fio(&c__1, ch__3, (ftnlen)12);
01252                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01253                                 ;
01254                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01255                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01256                                 ;
01257                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01258                                 integer));
01259                         e_wsfe();
01260                         *info = abs(iinfo);
01261                         if (iinfo < 0) {
01262                             return 0;
01263                         } else {
01264                             result[ntest] = ulpinv;
01265                             goto L310;
01266                         }
01267                     }
01268 
01269 /*                 Do Test */
01270 
01271                     dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01272                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01273                             work[1], &result[ntest]);
01274 
01275                     ++ntest;
01276 
01277 /*                 Copy the matrices into packed storage. */
01278 
01279                     if (lsame_(uplo, "U")) {
01280                         ij = 1;
01281                         i__3 = n;
01282                         for (j = 1; j <= i__3; ++j) {
01283                             i__4 = j;
01284                             for (i__ = 1; i__ <= i__4; ++i__) {
01285                                 ap[ij] = a[i__ + j * a_dim1];
01286                                 bp[ij] = b[i__ + j * b_dim1];
01287                                 ++ij;
01288 /* L230: */
01289                             }
01290 /* L240: */
01291                         }
01292                     } else {
01293                         ij = 1;
01294                         i__3 = n;
01295                         for (j = 1; j <= i__3; ++j) {
01296                             i__4 = n;
01297                             for (i__ = j; i__ <= i__4; ++i__) {
01298                                 ap[ij] = a[i__ + j * a_dim1];
01299                                 bp[ij] = b[i__ + j * b_dim1];
01300                                 ++ij;
01301 /* L250: */
01302                             }
01303 /* L260: */
01304                         }
01305                     }
01306 
01307                     vl = 0.;
01308                     vu = anorm;
01309                     dspgvx_(&ibtype, "V", "V", uplo, &n, &ap[1], &bp[1], &vl, 
01310                             &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01311                             z_offset], ldz, &work[1], &iwork[n + 1], &iwork[1]
01312 , info);
01313                     if (iinfo != 0) {
01314                         io___56.ciunit = *nounit;
01315                         s_wsfe(&io___56);
01316 /* Writing concatenation */
01317                         i__6[0] = 10, a__1[0] = "DSPGVX(V,V";
01318                         i__6[1] = 1, a__1[1] = uplo;
01319                         i__6[2] = 1, a__1[2] = ")";
01320                         s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01321                         do_fio(&c__1, ch__3, (ftnlen)12);
01322                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01323                                 ;
01324                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01325                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01326                                 ;
01327                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01328                                 integer));
01329                         e_wsfe();
01330                         *info = abs(iinfo);
01331                         if (iinfo < 0) {
01332                             return 0;
01333                         } else {
01334                             result[ntest] = ulpinv;
01335                             goto L310;
01336                         }
01337                     }
01338 
01339 /*                 Do Test */
01340 
01341                     dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01342                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01343                             work[1], &result[ntest]);
01344 
01345                     ++ntest;
01346 
01347 /*                 Copy the matrices into packed storage. */
01348 
01349                     if (lsame_(uplo, "U")) {
01350                         ij = 1;
01351                         i__3 = n;
01352                         for (j = 1; j <= i__3; ++j) {
01353                             i__4 = j;
01354                             for (i__ = 1; i__ <= i__4; ++i__) {
01355                                 ap[ij] = a[i__ + j * a_dim1];
01356                                 bp[ij] = b[i__ + j * b_dim1];
01357                                 ++ij;
01358 /* L270: */
01359                             }
01360 /* L280: */
01361                         }
01362                     } else {
01363                         ij = 1;
01364                         i__3 = n;
01365                         for (j = 1; j <= i__3; ++j) {
01366                             i__4 = n;
01367                             for (i__ = j; i__ <= i__4; ++i__) {
01368                                 ap[ij] = a[i__ + j * a_dim1];
01369                                 bp[ij] = b[i__ + j * b_dim1];
01370                                 ++ij;
01371 /* L290: */
01372                             }
01373 /* L300: */
01374                         }
01375                     }
01376 
01377                     dspgvx_(&ibtype, "V", "I", uplo, &n, &ap[1], &bp[1], &vl, 
01378                             &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01379                             z_offset], ldz, &work[1], &iwork[n + 1], &iwork[1]
01380 , info);
01381                     if (iinfo != 0) {
01382                         io___57.ciunit = *nounit;
01383                         s_wsfe(&io___57);
01384 /* Writing concatenation */
01385                         i__6[0] = 10, a__1[0] = "DSPGVX(V,I";
01386                         i__6[1] = 1, a__1[1] = uplo;
01387                         i__6[2] = 1, a__1[2] = ")";
01388                         s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01389                         do_fio(&c__1, ch__3, (ftnlen)12);
01390                         do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01391                                 ;
01392                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01393                         do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01394                                 ;
01395                         do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01396                                 integer));
01397                         e_wsfe();
01398                         *info = abs(iinfo);
01399                         if (iinfo < 0) {
01400                             return 0;
01401                         } else {
01402                             result[ntest] = ulpinv;
01403                             goto L310;
01404                         }
01405                     }
01406 
01407 /*                 Do Test */
01408 
01409                     dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01410                             b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01411                             work[1], &result[ntest]);
01412 
01413 L310:
01414 
01415                     if (ibtype == 1) {
01416 
01417 /*                    TEST DSBGV */
01418 
01419                         ++ntest;
01420 
01421 /*                    Copy the matrices into band storage. */
01422 
01423                         if (lsame_(uplo, "U")) {
01424                             i__3 = n;
01425                             for (j = 1; j <= i__3; ++j) {
01426 /* Computing MAX */
01427                                 i__4 = 1, i__5 = j - ka;
01428                                 i__7 = j;
01429                                 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01430                                          {
01431                                     ab[ka + 1 + i__ - j + j * ab_dim1] = a[
01432                                             i__ + j * a_dim1];
01433 /* L320: */
01434                                 }
01435 /* Computing MAX */
01436                                 i__7 = 1, i__4 = j - kb;
01437                                 i__5 = j;
01438                                 for (i__ = max(i__7,i__4); i__ <= i__5; ++i__)
01439                                          {
01440                                     bb[kb + 1 + i__ - j + j * bb_dim1] = b[
01441                                             i__ + j * b_dim1];
01442 /* L330: */
01443                                 }
01444 /* L340: */
01445                             }
01446                         } else {
01447                             i__3 = n;
01448                             for (j = 1; j <= i__3; ++j) {
01449 /* Computing MIN */
01450                                 i__7 = n, i__4 = j + ka;
01451                                 i__5 = min(i__7,i__4);
01452                                 for (i__ = j; i__ <= i__5; ++i__) {
01453                                     ab[i__ + 1 - j + j * ab_dim1] = a[i__ + j 
01454                                             * a_dim1];
01455 /* L350: */
01456                                 }
01457 /* Computing MIN */
01458                                 i__7 = n, i__4 = j + kb;
01459                                 i__5 = min(i__7,i__4);
01460                                 for (i__ = j; i__ <= i__5; ++i__) {
01461                                     bb[i__ + 1 - j + j * bb_dim1] = b[i__ + j 
01462                                             * b_dim1];
01463 /* L360: */
01464                                 }
01465 /* L370: */
01466                             }
01467                         }
01468 
01469                         dsbgv_("V", uplo, &n, &ka, &kb, &ab[ab_offset], lda, &
01470                                 bb[bb_offset], ldb, &d__[1], &z__[z_offset], 
01471                                 ldz, &work[1], &iinfo);
01472                         if (iinfo != 0) {
01473                             io___58.ciunit = *nounit;
01474                             s_wsfe(&io___58);
01475 /* Writing concatenation */
01476                             i__6[0] = 8, a__1[0] = "DSBGV(V,";
01477                             i__6[1] = 1, a__1[1] = uplo;
01478                             i__6[2] = 1, a__1[2] = ")";
01479                             s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)10);
01480                             do_fio(&c__1, ch__1, (ftnlen)10);
01481                             do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01482                                     integer));
01483                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01484                                     ;
01485                             do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01486                                     integer));
01487                             do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01488                                     integer));
01489                             e_wsfe();
01490                             *info = abs(iinfo);
01491                             if (iinfo < 0) {
01492                                 return 0;
01493                             } else {
01494                                 result[ntest] = ulpinv;
01495                                 goto L620;
01496                             }
01497                         }
01498 
01499 /*                    Do Test */
01500 
01501                         dsgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01502                                 b_offset], ldb, &z__[z_offset], ldz, &d__[1], 
01503                                 &work[1], &result[ntest]);
01504 
01505 /*                    TEST DSBGVD */
01506 
01507                         ++ntest;
01508 
01509 /*                    Copy the matrices into band storage. */
01510 
01511                         if (lsame_(uplo, "U")) {
01512                             i__3 = n;
01513                             for (j = 1; j <= i__3; ++j) {
01514 /* Computing MAX */
01515                                 i__5 = 1, i__7 = j - ka;
01516                                 i__4 = j;
01517                                 for (i__ = max(i__5,i__7); i__ <= i__4; ++i__)
01518                                          {
01519                                     ab[ka + 1 + i__ - j + j * ab_dim1] = a[
01520                                             i__ + j * a_dim1];
01521 /* L380: */
01522                                 }
01523 /* Computing MAX */
01524                                 i__4 = 1, i__5 = j - kb;
01525                                 i__7 = j;
01526                                 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01527                                          {
01528                                     bb[kb + 1 + i__ - j + j * bb_dim1] = b[
01529                                             i__ + j * b_dim1];
01530 /* L390: */
01531                                 }
01532 /* L400: */
01533                             }
01534                         } else {
01535                             i__3 = n;
01536                             for (j = 1; j <= i__3; ++j) {
01537 /* Computing MIN */
01538                                 i__4 = n, i__5 = j + ka;
01539                                 i__7 = min(i__4,i__5);
01540                                 for (i__ = j; i__ <= i__7; ++i__) {
01541                                     ab[i__ + 1 - j + j * ab_dim1] = a[i__ + j 
01542                                             * a_dim1];
01543 /* L410: */
01544                                 }
01545 /* Computing MIN */
01546                                 i__4 = n, i__5 = j + kb;
01547                                 i__7 = min(i__4,i__5);
01548                                 for (i__ = j; i__ <= i__7; ++i__) {
01549                                     bb[i__ + 1 - j + j * bb_dim1] = b[i__ + j 
01550                                             * b_dim1];
01551 /* L420: */
01552                                 }
01553 /* L430: */
01554                             }
01555                         }
01556 
01557                         dsbgvd_("V", uplo, &n, &ka, &kb, &ab[ab_offset], lda, 
01558                                 &bb[bb_offset], ldb, &d__[1], &z__[z_offset], 
01559                                 ldz, &work[1], nwork, &iwork[1], liwork, &
01560                                 iinfo);
01561                         if (iinfo != 0) {
01562                             io___59.ciunit = *nounit;
01563                             s_wsfe(&io___59);
01564 /* Writing concatenation */
01565                             i__6[0] = 9, a__1[0] = "DSBGVD(V,";
01566                             i__6[1] = 1, a__1[1] = uplo;
01567                             i__6[2] = 1, a__1[2] = ")";
01568                             s_cat(ch__2, a__1, i__6, &c__3, (ftnlen)11);
01569                             do_fio(&c__1, ch__2, (ftnlen)11);
01570                             do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01571                                     integer));
01572                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01573                                     ;
01574                             do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01575                                     integer));
01576                             do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01577                                     integer));
01578                             e_wsfe();
01579                             *info = abs(iinfo);
01580                             if (iinfo < 0) {
01581                                 return 0;
01582                             } else {
01583                                 result[ntest] = ulpinv;
01584                                 goto L620;
01585                             }
01586                         }
01587 
01588 /*                    Do Test */
01589 
01590                         dsgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01591                                 b_offset], ldb, &z__[z_offset], ldz, &d__[1], 
01592                                 &work[1], &result[ntest]);
01593 
01594 /*                    Test DSBGVX */
01595 
01596                         ++ntest;
01597 
01598 /*                    Copy the matrices into band storage. */
01599 
01600                         if (lsame_(uplo, "U")) {
01601                             i__3 = n;
01602                             for (j = 1; j <= i__3; ++j) {
01603 /* Computing MAX */
01604                                 i__7 = 1, i__4 = j - ka;
01605                                 i__5 = j;
01606                                 for (i__ = max(i__7,i__4); i__ <= i__5; ++i__)
01607                                          {
01608                                     ab[ka + 1 + i__ - j + j * ab_dim1] = a[
01609                                             i__ + j * a_dim1];
01610 /* L440: */
01611                                 }
01612 /* Computing MAX */
01613                                 i__5 = 1, i__7 = j - kb;
01614                                 i__4 = j;
01615                                 for (i__ = max(i__5,i__7); i__ <= i__4; ++i__)
01616                                          {
01617                                     bb[kb + 1 + i__ - j + j * bb_dim1] = b[
01618                                             i__ + j * b_dim1];
01619 /* L450: */
01620                                 }
01621 /* L460: */
01622                             }
01623                         } else {
01624                             i__3 = n;
01625                             for (j = 1; j <= i__3; ++j) {
01626 /* Computing MIN */
01627                                 i__5 = n, i__7 = j + ka;
01628                                 i__4 = min(i__5,i__7);
01629                                 for (i__ = j; i__ <= i__4; ++i__) {
01630                                     ab[i__ + 1 - j + j * ab_dim1] = a[i__ + j 
01631                                             * a_dim1];
01632 /* L470: */
01633                                 }
01634 /* Computing MIN */
01635                                 i__5 = n, i__7 = j + kb;
01636                                 i__4 = min(i__5,i__7);
01637                                 for (i__ = j; i__ <= i__4; ++i__) {
01638                                     bb[i__ + 1 - j + j * bb_dim1] = b[i__ + j 
01639                                             * b_dim1];
01640 /* L480: */
01641                                 }
01642 /* L490: */
01643                             }
01644                         }
01645 
01646                         i__3 = max(1,n);
01647                         dsbgvx_("V", "A", uplo, &n, &ka, &kb, &ab[ab_offset], 
01648                                 lda, &bb[bb_offset], ldb, &bp[1], &i__3, &vl, 
01649                                 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01650                                 z_offset], ldz, &work[1], &iwork[n + 1], &
01651                                 iwork[1], &iinfo);
01652                         if (iinfo != 0) {
01653                             io___60.ciunit = *nounit;
01654                             s_wsfe(&io___60);
01655 /* Writing concatenation */
01656                             i__6[0] = 10, a__1[0] = "DSBGVX(V,A";
01657                             i__6[1] = 1, a__1[1] = uplo;
01658                             i__6[2] = 1, a__1[2] = ")";
01659                             s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01660                             do_fio(&c__1, ch__3, (ftnlen)12);
01661                             do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01662                                     integer));
01663                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01664                                     ;
01665                             do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01666                                     integer));
01667                             do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01668                                     integer));
01669                             e_wsfe();
01670                             *info = abs(iinfo);
01671                             if (iinfo < 0) {
01672                                 return 0;
01673                             } else {
01674                                 result[ntest] = ulpinv;
01675                                 goto L620;
01676                             }
01677                         }
01678 
01679 /*                    Do Test */
01680 
01681                         dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01682                                 b_offset], ldb, &z__[z_offset], ldz, &d__[1], 
01683                                 &work[1], &result[ntest]);
01684 
01685 
01686                         ++ntest;
01687 
01688 /*                    Copy the matrices into band storage. */
01689 
01690                         if (lsame_(uplo, "U")) {
01691                             i__3 = n;
01692                             for (j = 1; j <= i__3; ++j) {
01693 /* Computing MAX */
01694                                 i__4 = 1, i__5 = j - ka;
01695                                 i__7 = j;
01696                                 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01697                                          {
01698                                     ab[ka + 1 + i__ - j + j * ab_dim1] = a[
01699                                             i__ + j * a_dim1];
01700 /* L500: */
01701                                 }
01702 /* Computing MAX */
01703                                 i__7 = 1, i__4 = j - kb;
01704                                 i__5 = j;
01705                                 for (i__ = max(i__7,i__4); i__ <= i__5; ++i__)
01706                                          {
01707                                     bb[kb + 1 + i__ - j + j * bb_dim1] = b[
01708                                             i__ + j * b_dim1];
01709 /* L510: */
01710                                 }
01711 /* L520: */
01712                             }
01713                         } else {
01714                             i__3 = n;
01715                             for (j = 1; j <= i__3; ++j) {
01716 /* Computing MIN */
01717                                 i__7 = n, i__4 = j + ka;
01718                                 i__5 = min(i__7,i__4);
01719                                 for (i__ = j; i__ <= i__5; ++i__) {
01720                                     ab[i__ + 1 - j + j * ab_dim1] = a[i__ + j 
01721                                             * a_dim1];
01722 /* L530: */
01723                                 }
01724 /* Computing MIN */
01725                                 i__7 = n, i__4 = j + kb;
01726                                 i__5 = min(i__7,i__4);
01727                                 for (i__ = j; i__ <= i__5; ++i__) {
01728                                     bb[i__ + 1 - j + j * bb_dim1] = b[i__ + j 
01729                                             * b_dim1];
01730 /* L540: */
01731                                 }
01732 /* L550: */
01733                             }
01734                         }
01735 
01736                         vl = 0.;
01737                         vu = anorm;
01738                         i__3 = max(1,n);
01739                         dsbgvx_("V", "V", uplo, &n, &ka, &kb, &ab[ab_offset], 
01740                                 lda, &bb[bb_offset], ldb, &bp[1], &i__3, &vl, 
01741                                 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01742                                 z_offset], ldz, &work[1], &iwork[n + 1], &
01743                                 iwork[1], &iinfo);
01744                         if (iinfo != 0) {
01745                             io___61.ciunit = *nounit;
01746                             s_wsfe(&io___61);
01747 /* Writing concatenation */
01748                             i__6[0] = 10, a__1[0] = "DSBGVX(V,V";
01749                             i__6[1] = 1, a__1[1] = uplo;
01750                             i__6[2] = 1, a__1[2] = ")";
01751                             s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01752                             do_fio(&c__1, ch__3, (ftnlen)12);
01753                             do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01754                                     integer));
01755                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01756                                     ;
01757                             do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01758                                     integer));
01759                             do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01760                                     integer));
01761                             e_wsfe();
01762                             *info = abs(iinfo);
01763                             if (iinfo < 0) {
01764                                 return 0;
01765                             } else {
01766                                 result[ntest] = ulpinv;
01767                                 goto L620;
01768                             }
01769                         }
01770 
01771 /*                    Do Test */
01772 
01773                         dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01774                                 b_offset], ldb, &z__[z_offset], ldz, &d__[1], 
01775                                 &work[1], &result[ntest]);
01776 
01777                         ++ntest;
01778 
01779 /*                    Copy the matrices into band storage. */
01780 
01781                         if (lsame_(uplo, "U")) {
01782                             i__3 = n;
01783                             for (j = 1; j <= i__3; ++j) {
01784 /* Computing MAX */
01785                                 i__5 = 1, i__7 = j - ka;
01786                                 i__4 = j;
01787                                 for (i__ = max(i__5,i__7); i__ <= i__4; ++i__)
01788                                          {
01789                                     ab[ka + 1 + i__ - j + j * ab_dim1] = a[
01790                                             i__ + j * a_dim1];
01791 /* L560: */
01792                                 }
01793 /* Computing MAX */
01794                                 i__4 = 1, i__5 = j - kb;
01795                                 i__7 = j;
01796                                 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01797                                          {
01798                                     bb[kb + 1 + i__ - j + j * bb_dim1] = b[
01799                                             i__ + j * b_dim1];
01800 /* L570: */
01801                                 }
01802 /* L580: */
01803                             }
01804                         } else {
01805                             i__3 = n;
01806                             for (j = 1; j <= i__3; ++j) {
01807 /* Computing MIN */
01808                                 i__4 = n, i__5 = j + ka;
01809                                 i__7 = min(i__4,i__5);
01810                                 for (i__ = j; i__ <= i__7; ++i__) {
01811                                     ab[i__ + 1 - j + j * ab_dim1] = a[i__ + j 
01812                                             * a_dim1];
01813 /* L590: */
01814                                 }
01815 /* Computing MIN */
01816                                 i__4 = n, i__5 = j + kb;
01817                                 i__7 = min(i__4,i__5);
01818                                 for (i__ = j; i__ <= i__7; ++i__) {
01819                                     bb[i__ + 1 - j + j * bb_dim1] = b[i__ + j 
01820                                             * b_dim1];
01821 /* L600: */
01822                                 }
01823 /* L610: */
01824                             }
01825                         }
01826 
01827                         i__3 = max(1,n);
01828                         dsbgvx_("V", "I", uplo, &n, &ka, &kb, &ab[ab_offset], 
01829                                 lda, &bb[bb_offset], ldb, &bp[1], &i__3, &vl, 
01830                                 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01831                                 z_offset], ldz, &work[1], &iwork[n + 1], &
01832                                 iwork[1], &iinfo);
01833                         if (iinfo != 0) {
01834                             io___62.ciunit = *nounit;
01835                             s_wsfe(&io___62);
01836 /* Writing concatenation */
01837                             i__6[0] = 10, a__1[0] = "DSBGVX(V,I";
01838                             i__6[1] = 1, a__1[1] = uplo;
01839                             i__6[2] = 1, a__1[2] = ")";
01840                             s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01841                             do_fio(&c__1, ch__3, (ftnlen)12);
01842                             do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01843                                     integer));
01844                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01845                                     ;
01846                             do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01847                                     integer));
01848                             do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01849                                     integer));
01850                             e_wsfe();
01851                             *info = abs(iinfo);
01852                             if (iinfo < 0) {
01853                                 return 0;
01854                             } else {
01855                                 result[ntest] = ulpinv;
01856                                 goto L620;
01857                             }
01858                         }
01859 
01860 /*                    Do Test */
01861 
01862                         dsgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01863                                 b_offset], ldb, &z__[z_offset], ldz, &d__[1], 
01864                                 &work[1], &result[ntest]);
01865 
01866                     }
01867 
01868 L620:
01869                     ;
01870                 }
01871 /* L630: */
01872             }
01873 
01874 /*           End of Loop -- Check for RESULT(j) > THRESH */
01875 
01876             ntestt += ntest;
01877             dlafts_("DSG", &n, &n, &jtype, &ntest, &result[1], ioldsd, thresh, 
01878                      nounit, &nerrs);
01879 L640:
01880             ;
01881         }
01882 /* L650: */
01883     }
01884 
01885 /*     Summary */
01886 
01887     dlasum_("DSG", nounit, &nerrs, &ntestt);
01888 
01889     return 0;
01890 
01891 /*     End of DDRVSG */
01892 
01893 } /* ddrvsg_ */


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