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


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