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


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