zdrvsy.c
Go to the documentation of this file.
00001 /* zdrvsy.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 /* Common Block Declarations */
00017 
00018 struct {
00019     integer infot, nunit;
00020     logical ok, lerr;
00021 } infoc_;
00022 
00023 #define infoc_1 infoc_
00024 
00025 struct {
00026     char srnamt[32];
00027 } srnamc_;
00028 
00029 #define srnamc_1 srnamc_
00030 
00031 /* Table of constant values */
00032 
00033 static integer c__1 = 1;
00034 static integer c__2 = 2;
00035 static integer c__0 = 0;
00036 static integer c_n1 = -1;
00037 static doublecomplex c_b49 = {0.,0.};
00038 
00039 /* Subroutine */ int zdrvsy_(logical *dotype, integer *nn, integer *nval, 
00040         integer *nrhs, doublereal *thresh, logical *tsterr, integer *nmax, 
00041         doublecomplex *a, doublecomplex *afac, doublecomplex *ainv, 
00042         doublecomplex *b, doublecomplex *x, doublecomplex *xact, 
00043         doublecomplex *work, doublereal *rwork, integer *iwork, integer *nout)
00044 {
00045     /* Initialized data */
00046 
00047     static integer iseedy[4] = { 1988,1989,1990,1991 };
00048     static char uplos[1*2] = "U" "L";
00049     static char facts[1*2] = "F" "N";
00050 
00051     /* Format strings */
00052     static char fmt_9999[] = "(1x,a,\002, UPLO='\002,a1,\002', N =\002,i5"
00053             ",\002, type \002,i2,\002, test \002,i2,\002, ratio =\002,g12.5)";
00054     static char fmt_9998[] = "(1x,a,\002, FACT='\002,a1,\002', UPLO='\002,"
00055             "a1,\002', N =\002,i5,\002, type \002,i2,\002, test \002,i2,\002,"
00056             " ratio =\002,g12.5)";
00057 
00058     /* System generated locals */
00059     address a__1[2];
00060     integer i__1, i__2, i__3, i__4, i__5, i__6[2];
00061     char ch__1[2];
00062 
00063     /* Builtin functions */
00064     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00065     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00066     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
00067 
00068     /* Local variables */
00069     integer i__, j, k, n, i1, i2, k1, nb, in, kl, ku, nt, lda;
00070     char fact[1];
00071     integer ioff, mode, imat, info;
00072     char path[3], dist[1], uplo[1], type__[1];
00073     integer nrun, ifact, nfail, iseed[4];
00074     extern doublereal dget06_(doublereal *, doublereal *);
00075     integer nbmin;
00076     doublereal rcond;
00077     integer nimat;
00078     doublereal anorm;
00079     extern /* Subroutine */ int zget04_(integer *, integer *, doublecomplex *, 
00080              integer *, doublecomplex *, integer *, doublereal *, doublereal *
00081 );
00082     integer iuplo, izero, nerrs, lwork;
00083     extern /* Subroutine */ int zpot05_(char *, integer *, integer *, 
00084             doublecomplex *, integer *, doublecomplex *, integer *, 
00085             doublecomplex *, integer *, doublecomplex *, integer *, 
00086             doublereal *, doublereal *, doublereal *);
00087     logical zerot;
00088     char xtype[1];
00089     extern /* Subroutine */ int zsyt01_(char *, integer *, doublecomplex *, 
00090             integer *, doublecomplex *, integer *, integer *, doublecomplex *, 
00091              integer *, doublereal *, doublereal *), zsyt02_(char *, 
00092             integer *, integer *, doublecomplex *, integer *, doublecomplex *, 
00093              integer *, doublecomplex *, integer *, doublereal *, doublereal *
00094 ), zsysv_(char *, integer *, integer *, doublecomplex *, 
00095             integer *, integer *, doublecomplex *, integer *, doublecomplex *, 
00096              integer *, integer *), zlatb4_(char *, integer *, 
00097             integer *, integer *, char *, integer *, integer *, doublereal *, 
00098             integer *, doublereal *, char *), aladhd_(
00099             integer *, char *), alaerh_(char *, char *, integer *, 
00100             integer *, char *, integer *, integer *, integer *, integer *, 
00101             integer *, integer *, integer *, integer *, integer *);
00102     doublereal rcondc;
00103     extern /* Subroutine */ int alasvm_(char *, integer *, integer *, integer 
00104             *, integer *);
00105     doublereal cndnum, ainvnm;
00106     extern /* Subroutine */ int xlaenv_(integer *, integer *), zlacpy_(char *, 
00107              integer *, integer *, doublecomplex *, integer *, doublecomplex *
00108 , integer *), zlarhs_(char *, char *, char *, char *, 
00109             integer *, integer *, integer *, integer *, integer *, 
00110             doublecomplex *, integer *, doublecomplex *, integer *, 
00111             doublecomplex *, integer *, integer *, integer *), zlaset_(char *, integer *, integer *, 
00112             doublecomplex *, doublecomplex *, doublecomplex *, integer *), zlatms_(integer *, integer *, char *, integer *, char *, 
00113             doublereal *, integer *, doublereal *, doublereal *, integer *, 
00114             integer *, char *, doublecomplex *, integer *, doublecomplex *, 
00115             integer *);
00116     doublereal result[6];
00117     extern doublereal zlansy_(char *, char *, integer *, doublecomplex *, 
00118             integer *, doublereal *);
00119     extern /* Subroutine */ int zlatsy_(char *, integer *, doublecomplex *, 
00120             integer *, integer *), zerrvx_(char *, integer *),
00121              zsytrf_(char *, integer *, doublecomplex *, integer *, integer *, 
00122              doublecomplex *, integer *, integer *), zsytri_(char *, 
00123             integer *, doublecomplex *, integer *, integer *, doublecomplex *, 
00124              integer *), zsysvx_(char *, char *, integer *, integer *, 
00125              doublecomplex *, integer *, doublecomplex *, integer *, integer *
00126 , doublecomplex *, integer *, doublecomplex *, integer *, 
00127             doublereal *, doublereal *, doublereal *, doublecomplex *, 
00128             integer *, doublereal *, integer *);
00129 
00130     /* Fortran I/O blocks */
00131     static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00132     static cilist io___45 = { 0, 0, 0, fmt_9998, 0 };
00133 
00134 
00135 
00136 /*  -- LAPACK test routine (version 3.1) -- */
00137 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00138 /*     November 2006 */
00139 
00140 /*     .. Scalar Arguments .. */
00141 /*     .. */
00142 /*     .. Array Arguments .. */
00143 /*     .. */
00144 
00145 /*  Purpose */
00146 /*  ======= */
00147 
00148 /*  ZDRVSY tests the driver routines ZSYSV and -SVX. */
00149 
00150 /*  Arguments */
00151 /*  ========= */
00152 
00153 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00154 /*          The matrix types to be used for testing.  Matrices of type j */
00155 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00156 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00157 
00158 /*  NN      (input) INTEGER */
00159 /*          The number of values of N contained in the vector NVAL. */
00160 
00161 /*  NVAL    (input) INTEGER array, dimension (NN) */
00162 /*          The values of the matrix dimension N. */
00163 
00164 /*  NRHS    (input) INTEGER */
00165 /*          The number of right hand side vectors to be generated for */
00166 /*          each linear system. */
00167 
00168 /*  THRESH  (input) DOUBLE PRECISION */
00169 /*          The threshold value for the test ratios.  A result is */
00170 /*          included in the output file if RESULT >= THRESH.  To have */
00171 /*          every test ratio printed, use THRESH = 0. */
00172 
00173 /*  TSTERR  (input) LOGICAL */
00174 /*          Flag that indicates whether error exits are to be tested. */
00175 
00176 /*  NMAX    (input) INTEGER */
00177 /*          The maximum value permitted for N, used in dimensioning the */
00178 /*          work arrays. */
00179 
00180 /*  A       (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00181 
00182 /*  AFAC    (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00183 
00184 /*  AINV    (workspace) COMPLEX*16 array, dimension (NMAX*NMAX) */
00185 
00186 /*  B       (workspace) COMPLEX*16 array, dimension (NMAX*NRHS) */
00187 
00188 /*  X       (workspace) COMPLEX*16 array, dimension (NMAX*NRHS) */
00189 
00190 /*  XACT    (workspace) COMPLEX*16 array, dimension (NMAX*NRHS) */
00191 
00192 /*  WORK    (workspace) COMPLEX*16 array, dimension */
00193 /*                      (NMAX*max(2,NRHS)) */
00194 
00195 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension (NMAX+2*NRHS) */
00196 
00197 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00198 
00199 /*  NOUT    (input) INTEGER */
00200 /*          The unit number for output. */
00201 
00202 /*  ===================================================================== */
00203 
00204 /*     .. Parameters .. */
00205 /*     .. */
00206 /*     .. Local Scalars .. */
00207 /*     .. */
00208 /*     .. Local Arrays .. */
00209 /*     .. */
00210 /*     .. External Functions .. */
00211 /*     .. */
00212 /*     .. External Subroutines .. */
00213 /*     .. */
00214 /*     .. Scalars in Common .. */
00215 /*     .. */
00216 /*     .. Common blocks .. */
00217 /*     .. */
00218 /*     .. Intrinsic Functions .. */
00219 /*     .. */
00220 /*     .. Data statements .. */
00221     /* Parameter adjustments */
00222     --iwork;
00223     --rwork;
00224     --work;
00225     --xact;
00226     --x;
00227     --b;
00228     --ainv;
00229     --afac;
00230     --a;
00231     --nval;
00232     --dotype;
00233 
00234     /* Function Body */
00235 /*     .. */
00236 /*     .. Executable Statements .. */
00237 
00238 /*     Initialize constants and the random number seed. */
00239 
00240     s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00241     s_copy(path + 1, "SY", (ftnlen)2, (ftnlen)2);
00242     nrun = 0;
00243     nfail = 0;
00244     nerrs = 0;
00245     for (i__ = 1; i__ <= 4; ++i__) {
00246         iseed[i__ - 1] = iseedy[i__ - 1];
00247 /* L10: */
00248     }
00249 /* Computing MAX */
00250     i__1 = *nmax << 1, i__2 = *nmax * *nrhs;
00251     lwork = max(i__1,i__2);
00252 
00253 /*     Test the error exits */
00254 
00255     if (*tsterr) {
00256         zerrvx_(path, nout);
00257     }
00258     infoc_1.infot = 0;
00259 
00260 /*     Set the block size and minimum block size for testing. */
00261 
00262     nb = 1;
00263     nbmin = 2;
00264     xlaenv_(&c__1, &nb);
00265     xlaenv_(&c__2, &nbmin);
00266 
00267 /*     Do for each value of N in NVAL */
00268 
00269     i__1 = *nn;
00270     for (in = 1; in <= i__1; ++in) {
00271         n = nval[in];
00272         lda = max(n,1);
00273         *(unsigned char *)xtype = 'N';
00274         nimat = 11;
00275         if (n <= 0) {
00276             nimat = 1;
00277         }
00278 
00279         i__2 = nimat;
00280         for (imat = 1; imat <= i__2; ++imat) {
00281 
00282 /*           Do the tests only if DOTYPE( IMAT ) is true. */
00283 
00284             if (! dotype[imat]) {
00285                 goto L170;
00286             }
00287 
00288 /*           Skip types 3, 4, 5, or 6 if the matrix size is too small. */
00289 
00290             zerot = imat >= 3 && imat <= 6;
00291             if (zerot && n < imat - 2) {
00292                 goto L170;
00293             }
00294 
00295 /*           Do first for UPLO = 'U', then for UPLO = 'L' */
00296 
00297             for (iuplo = 1; iuplo <= 2; ++iuplo) {
00298                 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00299 
00300                 if (imat != 11) {
00301 
00302 /*                 Set up parameters with ZLATB4 and generate a test */
00303 /*                 matrix with ZLATMS. */
00304 
00305                     zlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &
00306                             mode, &cndnum, dist);
00307 
00308                     s_copy(srnamc_1.srnamt, "ZLATMS", (ftnlen)32, (ftnlen)6);
00309                     zlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00310                             cndnum, &anorm, &kl, &ku, uplo, &a[1], &lda, &
00311                             work[1], &info);
00312 
00313 /*                 Check error code from ZLATMS. */
00314 
00315                     if (info != 0) {
00316                         alaerh_(path, "ZLATMS", &info, &c__0, uplo, &n, &n, &
00317                                 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs, 
00318                                 nout);
00319                         goto L160;
00320                     }
00321 
00322 /*                 For types 3-6, zero one or more rows and columns of */
00323 /*                 the matrix to test that INFO is returned correctly. */
00324 
00325                     if (zerot) {
00326                         if (imat == 3) {
00327                             izero = 1;
00328                         } else if (imat == 4) {
00329                             izero = n;
00330                         } else {
00331                             izero = n / 2 + 1;
00332                         }
00333 
00334                         if (imat < 6) {
00335 
00336 /*                       Set row and column IZERO to zero. */
00337 
00338                             if (iuplo == 1) {
00339                                 ioff = (izero - 1) * lda;
00340                                 i__3 = izero - 1;
00341                                 for (i__ = 1; i__ <= i__3; ++i__) {
00342                                     i__4 = ioff + i__;
00343                                     a[i__4].r = 0., a[i__4].i = 0.;
00344 /* L20: */
00345                                 }
00346                                 ioff += izero;
00347                                 i__3 = n;
00348                                 for (i__ = izero; i__ <= i__3; ++i__) {
00349                                     i__4 = ioff;
00350                                     a[i__4].r = 0., a[i__4].i = 0.;
00351                                     ioff += lda;
00352 /* L30: */
00353                                 }
00354                             } else {
00355                                 ioff = izero;
00356                                 i__3 = izero - 1;
00357                                 for (i__ = 1; i__ <= i__3; ++i__) {
00358                                     i__4 = ioff;
00359                                     a[i__4].r = 0., a[i__4].i = 0.;
00360                                     ioff += lda;
00361 /* L40: */
00362                                 }
00363                                 ioff -= izero;
00364                                 i__3 = n;
00365                                 for (i__ = izero; i__ <= i__3; ++i__) {
00366                                     i__4 = ioff + i__;
00367                                     a[i__4].r = 0., a[i__4].i = 0.;
00368 /* L50: */
00369                                 }
00370                             }
00371                         } else {
00372                             if (iuplo == 1) {
00373 
00374 /*                          Set the first IZERO rows to zero. */
00375 
00376                                 ioff = 0;
00377                                 i__3 = n;
00378                                 for (j = 1; j <= i__3; ++j) {
00379                                     i2 = min(j,izero);
00380                                     i__4 = i2;
00381                                     for (i__ = 1; i__ <= i__4; ++i__) {
00382                                         i__5 = ioff + i__;
00383                                         a[i__5].r = 0., a[i__5].i = 0.;
00384 /* L60: */
00385                                     }
00386                                     ioff += lda;
00387 /* L70: */
00388                                 }
00389                             } else {
00390 
00391 /*                          Set the last IZERO rows to zero. */
00392 
00393                                 ioff = 0;
00394                                 i__3 = n;
00395                                 for (j = 1; j <= i__3; ++j) {
00396                                     i1 = max(j,izero);
00397                                     i__4 = n;
00398                                     for (i__ = i1; i__ <= i__4; ++i__) {
00399                                         i__5 = ioff + i__;
00400                                         a[i__5].r = 0., a[i__5].i = 0.;
00401 /* L80: */
00402                                     }
00403                                     ioff += lda;
00404 /* L90: */
00405                                 }
00406                             }
00407                         }
00408                     } else {
00409                         izero = 0;
00410                     }
00411                 } else {
00412 
00413 /*                 IMAT = NTYPES:  Use a special block diagonal matrix to */
00414 /*                 test alternate code for the 2-by-2 blocks. */
00415 
00416                     zlatsy_(uplo, &n, &a[1], &lda, iseed);
00417                 }
00418 
00419                 for (ifact = 1; ifact <= 2; ++ifact) {
00420 
00421 /*                 Do first for FACT = 'F', then for other values. */
00422 
00423                     *(unsigned char *)fact = *(unsigned char *)&facts[ifact - 
00424                             1];
00425 
00426 /*                 Compute the condition number for comparison with */
00427 /*                 the value returned by ZSYSVX. */
00428 
00429                     if (zerot) {
00430                         if (ifact == 1) {
00431                             goto L150;
00432                         }
00433                         rcondc = 0.;
00434 
00435                     } else if (ifact == 1) {
00436 
00437 /*                    Compute the 1-norm of A. */
00438 
00439                         anorm = zlansy_("1", uplo, &n, &a[1], &lda, &rwork[1]);
00440 
00441 /*                    Factor the matrix A. */
00442 
00443                         zlacpy_(uplo, &n, &n, &a[1], &lda, &afac[1], &lda);
00444                         zsytrf_(uplo, &n, &afac[1], &lda, &iwork[1], &work[1], 
00445                                  &lwork, &info);
00446 
00447 /*                    Compute inv(A) and take its norm. */
00448 
00449                         zlacpy_(uplo, &n, &n, &afac[1], &lda, &ainv[1], &lda);
00450                         zsytri_(uplo, &n, &ainv[1], &lda, &iwork[1], &work[1], 
00451                                  &info);
00452                         ainvnm = zlansy_("1", uplo, &n, &ainv[1], &lda, &
00453                                 rwork[1]);
00454 
00455 /*                    Compute the 1-norm condition number of A. */
00456 
00457                         if (anorm <= 0. || ainvnm <= 0.) {
00458                             rcondc = 1.;
00459                         } else {
00460                             rcondc = 1. / anorm / ainvnm;
00461                         }
00462                     }
00463 
00464 /*                 Form an exact solution and set the right hand side. */
00465 
00466                     s_copy(srnamc_1.srnamt, "ZLARHS", (ftnlen)32, (ftnlen)6);
00467                     zlarhs_(path, xtype, uplo, " ", &n, &n, &kl, &ku, nrhs, &
00468                             a[1], &lda, &xact[1], &lda, &b[1], &lda, iseed, &
00469                             info);
00470                     *(unsigned char *)xtype = 'C';
00471 
00472 /*                 --- Test ZSYSV  --- */
00473 
00474                     if (ifact == 2) {
00475                         zlacpy_(uplo, &n, &n, &a[1], &lda, &afac[1], &lda);
00476                         zlacpy_("Full", &n, nrhs, &b[1], &lda, &x[1], &lda);
00477 
00478 /*                    Factor the matrix and solve the system using ZSYSV. */
00479 
00480                         s_copy(srnamc_1.srnamt, "ZSYSV ", (ftnlen)32, (ftnlen)
00481                                 6);
00482                         zsysv_(uplo, &n, nrhs, &afac[1], &lda, &iwork[1], &x[
00483                                 1], &lda, &work[1], &lwork, &info);
00484 
00485 /*                    Adjust the expected value of INFO to account for */
00486 /*                    pivoting. */
00487 
00488                         k = izero;
00489                         if (k > 0) {
00490 L100:
00491                             if (iwork[k] < 0) {
00492                                 if (iwork[k] != -k) {
00493                                     k = -iwork[k];
00494                                     goto L100;
00495                                 }
00496                             } else if (iwork[k] != k) {
00497                                 k = iwork[k];
00498                                 goto L100;
00499                             }
00500                         }
00501 
00502 /*                    Check error code from ZSYSV . */
00503 
00504                         if (info != k) {
00505                             alaerh_(path, "ZSYSV ", &info, &k, uplo, &n, &n, &
00506                                     c_n1, &c_n1, nrhs, &imat, &nfail, &nerrs, 
00507                                     nout);
00508                             goto L120;
00509                         } else if (info != 0) {
00510                             goto L120;
00511                         }
00512 
00513 /*                    Reconstruct matrix from factors and compute */
00514 /*                    residual. */
00515 
00516                         zsyt01_(uplo, &n, &a[1], &lda, &afac[1], &lda, &iwork[
00517                                 1], &ainv[1], &lda, &rwork[1], result);
00518 
00519 /*                    Compute residual of the computed solution. */
00520 
00521                         zlacpy_("Full", &n, nrhs, &b[1], &lda, &work[1], &lda);
00522                         zsyt02_(uplo, &n, nrhs, &a[1], &lda, &x[1], &lda, &
00523                                 work[1], &lda, &rwork[1], &result[1]);
00524 
00525 /*                    Check solution from generated exact solution. */
00526 
00527                         zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda, &
00528                                 rcondc, &result[2]);
00529                         nt = 3;
00530 
00531 /*                    Print information about the tests that did not pass */
00532 /*                    the threshold. */
00533 
00534                         i__3 = nt;
00535                         for (k = 1; k <= i__3; ++k) {
00536                             if (result[k - 1] >= *thresh) {
00537                                 if (nfail == 0 && nerrs == 0) {
00538                                     aladhd_(nout, path);
00539                                 }
00540                                 io___42.ciunit = *nout;
00541                                 s_wsfe(&io___42);
00542                                 do_fio(&c__1, "ZSYSV ", (ftnlen)6);
00543                                 do_fio(&c__1, uplo, (ftnlen)1);
00544                                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00545                                         integer));
00546                                 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00547                                         integer));
00548                                 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00549                                         integer));
00550                                 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00551                                         sizeof(doublereal));
00552                                 e_wsfe();
00553                                 ++nfail;
00554                             }
00555 /* L110: */
00556                         }
00557                         nrun += nt;
00558 L120:
00559                         ;
00560                     }
00561 
00562 /*                 --- Test ZSYSVX --- */
00563 
00564                     if (ifact == 2) {
00565                         zlaset_(uplo, &n, &n, &c_b49, &c_b49, &afac[1], &lda);
00566                     }
00567                     zlaset_("Full", &n, nrhs, &c_b49, &c_b49, &x[1], &lda);
00568 
00569 /*                 Solve the system and compute the condition number and */
00570 /*                 error bounds using ZSYSVX. */
00571 
00572                     s_copy(srnamc_1.srnamt, "ZSYSVX", (ftnlen)32, (ftnlen)6);
00573                     zsysvx_(fact, uplo, &n, nrhs, &a[1], &lda, &afac[1], &lda, 
00574                              &iwork[1], &b[1], &lda, &x[1], &lda, &rcond, &
00575                             rwork[1], &rwork[*nrhs + 1], &work[1], &lwork, &
00576                             rwork[(*nrhs << 1) + 1], &info);
00577 
00578 /*                 Adjust the expected value of INFO to account for */
00579 /*                 pivoting. */
00580 
00581                     k = izero;
00582                     if (k > 0) {
00583 L130:
00584                         if (iwork[k] < 0) {
00585                             if (iwork[k] != -k) {
00586                                 k = -iwork[k];
00587                                 goto L130;
00588                             }
00589                         } else if (iwork[k] != k) {
00590                             k = iwork[k];
00591                             goto L130;
00592                         }
00593                     }
00594 
00595 /*                 Check the error code from ZSYSVX. */
00596 
00597                     if (info != k) {
00598 /* Writing concatenation */
00599                         i__6[0] = 1, a__1[0] = fact;
00600                         i__6[1] = 1, a__1[1] = uplo;
00601                         s_cat(ch__1, a__1, i__6, &c__2, (ftnlen)2);
00602                         alaerh_(path, "ZSYSVX", &info, &k, ch__1, &n, &n, &
00603                                 c_n1, &c_n1, nrhs, &imat, &nfail, &nerrs, 
00604                                 nout);
00605                         goto L150;
00606                     }
00607 
00608                     if (info == 0) {
00609                         if (ifact >= 2) {
00610 
00611 /*                       Reconstruct matrix from factors and compute */
00612 /*                       residual. */
00613 
00614                             zsyt01_(uplo, &n, &a[1], &lda, &afac[1], &lda, &
00615                                     iwork[1], &ainv[1], &lda, &rwork[(*nrhs <<
00616                                      1) + 1], result);
00617                             k1 = 1;
00618                         } else {
00619                             k1 = 2;
00620                         }
00621 
00622 /*                    Compute residual of the computed solution. */
00623 
00624                         zlacpy_("Full", &n, nrhs, &b[1], &lda, &work[1], &lda);
00625                         zsyt02_(uplo, &n, nrhs, &a[1], &lda, &x[1], &lda, &
00626                                 work[1], &lda, &rwork[(*nrhs << 1) + 1], &
00627                                 result[1]);
00628 
00629 /*                    Check solution from generated exact solution. */
00630 
00631                         zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda, &
00632                                 rcondc, &result[2]);
00633 
00634 /*                    Check the error bounds from iterative refinement. */
00635 
00636                         zpot05_(uplo, &n, nrhs, &a[1], &lda, &b[1], &lda, &x[
00637                                 1], &lda, &xact[1], &lda, &rwork[1], &rwork[*
00638                                 nrhs + 1], &result[3]);
00639                     } else {
00640                         k1 = 6;
00641                     }
00642 
00643 /*                 Compare RCOND from ZSYSVX with the computed value */
00644 /*                 in RCONDC. */
00645 
00646                     result[5] = dget06_(&rcond, &rcondc);
00647 
00648 /*                 Print information about the tests that did not pass */
00649 /*                 the threshold. */
00650 
00651                     for (k = k1; k <= 6; ++k) {
00652                         if (result[k - 1] >= *thresh) {
00653                             if (nfail == 0 && nerrs == 0) {
00654                                 aladhd_(nout, path);
00655                             }
00656                             io___45.ciunit = *nout;
00657                             s_wsfe(&io___45);
00658                             do_fio(&c__1, "ZSYSVX", (ftnlen)6);
00659                             do_fio(&c__1, fact, (ftnlen)1);
00660                             do_fio(&c__1, uplo, (ftnlen)1);
00661                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00662                                     ;
00663                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00664                                     integer));
00665                             do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer))
00666                                     ;
00667                             do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00668                                     sizeof(doublereal));
00669                             e_wsfe();
00670                             ++nfail;
00671                         }
00672 /* L140: */
00673                     }
00674                     nrun = nrun + 7 - k1;
00675 
00676 L150:
00677                     ;
00678                 }
00679 
00680 L160:
00681                 ;
00682             }
00683 L170:
00684             ;
00685         }
00686 /* L180: */
00687     }
00688 
00689 /*     Print a summary of the results. */
00690 
00691     alasvm_(path, nout, &nfail, &nrun, &nerrs);
00692 
00693     return 0;
00694 
00695 /*     End of ZDRVSY */
00696 
00697 } /* zdrvsy_ */


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