cdrvhp.c
Go to the documentation of this file.
00001 /* cdrvhp.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 complex c_b64 = {0.f,0.f};
00038 
00039 /* Subroutine */ int cdrvhp_(logical *dotype, integer *nn, integer *nval, 
00040         integer *nrhs, real *thresh, logical *tsterr, integer *nmax, complex *
00041         a, complex *afac, complex *ainv, complex *b, complex *x, complex *
00042         xact, complex *work, real *rwork, integer *iwork, integer *nout)
00043 {
00044     /* Initialized data */
00045 
00046     static integer iseedy[4] = { 1988,1989,1990,1991 };
00047     static char facts[1*2] = "F" "N";
00048 
00049     /* Format strings */
00050     static char fmt_9999[] = "(1x,a,\002, UPLO='\002,a1,\002', N =\002,i5"
00051             ",\002, type \002,i2,\002, test \002,i2,\002, ratio =\002,g12.5)";
00052     static char fmt_9998[] = "(1x,a,\002, FACT='\002,a1,\002', UPLO='\002,"
00053             "a1,\002', N =\002,i5,\002, type \002,i2,\002, test \002,i2,\002,"
00054             " ratio =\002,g12.5)";
00055 
00056     /* System generated locals */
00057     address a__1[2];
00058     integer i__1, i__2, i__3, i__4, i__5, i__6[2];
00059     char ch__1[2];
00060 
00061     /* Builtin functions */
00062     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00063     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00064     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
00065 
00066     /* Local variables */
00067     integer i__, j, k, n, i1, i2, k1, nb, in, kl, ku, nt, lda, npp;
00068     char fact[1];
00069     integer ioff, mode, imat, info;
00070     char path[3], dist[1], uplo[1], type__[1];
00071     integer nrun, ifact;
00072     extern /* Subroutine */ int cget04_(integer *, integer *, complex *, 
00073             integer *, complex *, integer *, real *, real *);
00074     integer nfail, iseed[4];
00075     extern /* Subroutine */ int chpt01_(char *, integer *, complex *, complex 
00076             *, integer *, complex *, integer *, real *, real *);
00077     integer nbmin;
00078     real rcond;
00079     integer nimat;
00080     extern doublereal sget06_(real *, real *);
00081     extern /* Subroutine */ int cppt02_(char *, integer *, integer *, complex 
00082             *, complex *, integer *, complex *, integer *, real *, real *), cppt05_(char *, integer *, integer *, complex *, complex 
00083             *, integer *, complex *, integer *, complex *, integer *, real *, 
00084             real *, real *);
00085     real anorm;
00086     extern /* Subroutine */ int ccopy_(integer *, complex *, integer *, 
00087             complex *, integer *), chpsv_(char *, integer *, integer *, 
00088             complex *, integer *, complex *, integer *, integer *);
00089     integer iuplo, izero, nerrs;
00090     logical zerot;
00091     char xtype[1];
00092     extern /* Subroutine */ int clatb4_(char *, integer *, integer *, integer 
00093             *, char *, integer *, integer *, real *, integer *, real *, char *
00094 ), aladhd_(integer *, char *), 
00095             alaerh_(char *, char *, integer *, integer *, char *, integer *, 
00096             integer *, integer *, integer *, integer *, integer *, integer *, 
00097             integer *, integer *), claipd_(integer *, 
00098             complex *, integer *, integer *);
00099     extern doublereal clanhp_(char *, char *, integer *, complex *, real *);
00100     real rcondc;
00101     char packit[1];
00102     extern /* Subroutine */ int clacpy_(char *, integer *, integer *, complex 
00103             *, integer *, complex *, integer *), clarhs_(char *, char 
00104             *, char *, char *, integer *, integer *, integer *, integer *, 
00105             integer *, complex *, integer *, complex *, integer *, complex *, 
00106             integer *, integer *, integer *), 
00107             claset_(char *, integer *, integer *, complex *, complex *, 
00108             complex *, integer *), alasvm_(char *, integer *, integer 
00109             *, integer *, integer *);
00110     real cndnum;
00111     extern /* Subroutine */ int clatms_(integer *, integer *, char *, integer 
00112             *, char *, real *, integer *, real *, real *, integer *, integer *
00113 , char *, complex *, integer *, complex *, integer *), chptrf_(char *, integer *, complex *, integer *, 
00114             integer *);
00115     real ainvnm;
00116     extern /* Subroutine */ int chptri_(char *, integer *, complex *, integer 
00117             *, complex *, integer *), xlaenv_(integer *, integer *), 
00118             cerrvx_(char *, integer *), chpsvx_(char *, char *, 
00119             integer *, integer *, complex *, complex *, integer *, complex *, 
00120             integer *, complex *, integer *, real *, real *, real *, complex *
00121 , real *, integer *);
00122     real result[6];
00123 
00124     /* Fortran I/O blocks */
00125     static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00126     static cilist io___45 = { 0, 0, 0, fmt_9998, 0 };
00127 
00128 
00129 
00130 /*  -- LAPACK test routine (version 3.1) -- */
00131 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00132 /*     November 2006 */
00133 
00134 /*     .. Scalar Arguments .. */
00135 /*     .. */
00136 /*     .. Array Arguments .. */
00137 /*     .. */
00138 
00139 /*  Purpose */
00140 /*  ======= */
00141 
00142 /*  CDRVHP tests the driver routines CHPSV and -SVX. */
00143 
00144 /*  Arguments */
00145 /*  ========= */
00146 
00147 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00148 /*          The matrix types to be used for testing.  Matrices of type j */
00149 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00150 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00151 
00152 /*  NN      (input) INTEGER */
00153 /*          The number of values of N contained in the vector NVAL. */
00154 
00155 /*  NVAL    (input) INTEGER array, dimension (NN) */
00156 /*          The values of the matrix dimension N. */
00157 
00158 /*  NRHS    (input) INTEGER */
00159 /*          The number of right hand side vectors to be generated for */
00160 /*          each linear system. */
00161 
00162 /*  THRESH  (input) REAL */
00163 /*          The threshold value for the test ratios.  A result is */
00164 /*          included in the output file if RESULT >= THRESH.  To have */
00165 /*          every test ratio printed, use THRESH = 0. */
00166 
00167 /*  TSTERR  (input) LOGICAL */
00168 /*          Flag that indicates whether error exits are to be tested. */
00169 
00170 /*  NMAX    (input) INTEGER */
00171 /*          The maximum value permitted for N, used in dimensioning the */
00172 /*          work arrays. */
00173 
00174 /*  A       (workspace) COMPLEX array, dimension */
00175 /*                      (NMAX*(NMAX+1)/2) */
00176 
00177 /*  AFAC    (workspace) COMPLEX array, dimension */
00178 /*                      (NMAX*(NMAX+1)/2) */
00179 
00180 /*  AINV    (workspace) COMPLEX array, dimension */
00181 /*                      (NMAX*(NMAX+1)/2) */
00182 
00183 /*  B       (workspace) COMPLEX array, dimension (NMAX*NRHS) */
00184 
00185 /*  X       (workspace) COMPLEX array, dimension (NMAX*NRHS) */
00186 
00187 /*  XACT    (workspace) COMPLEX array, dimension (NMAX*NRHS) */
00188 
00189 /*  WORK    (workspace) COMPLEX array, dimension */
00190 /*                      (NMAX*max(2,NRHS)) */
00191 
00192 /*  RWORK   (workspace) REAL array, dimension (NMAX+2*NRHS) */
00193 
00194 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00195 
00196 /*  NOUT    (input) INTEGER */
00197 /*          The unit number for output. */
00198 
00199 /*  ===================================================================== */
00200 
00201 /*     .. Parameters .. */
00202 /*     .. */
00203 /*     .. Local Scalars .. */
00204 /*     .. */
00205 /*     .. Local Arrays .. */
00206 /*     .. */
00207 /*     .. External Functions .. */
00208 /*     .. */
00209 /*     .. External Subroutines .. */
00210 /*     .. */
00211 /*     .. Scalars in Common .. */
00212 /*     .. */
00213 /*     .. Common blocks .. */
00214 /*     .. */
00215 /*     .. Intrinsic Functions .. */
00216 /*     .. */
00217 /*     .. Data statements .. */
00218     /* Parameter adjustments */
00219     --iwork;
00220     --rwork;
00221     --work;
00222     --xact;
00223     --x;
00224     --b;
00225     --ainv;
00226     --afac;
00227     --a;
00228     --nval;
00229     --dotype;
00230 
00231     /* Function Body */
00232 /*     .. */
00233 /*     .. Executable Statements .. */
00234 
00235 /*     Initialize constants and the random number seed. */
00236 
00237     *(unsigned char *)path = 'C';
00238     s_copy(path + 1, "HP", (ftnlen)2, (ftnlen)2);
00239     nrun = 0;
00240     nfail = 0;
00241     nerrs = 0;
00242     for (i__ = 1; i__ <= 4; ++i__) {
00243         iseed[i__ - 1] = iseedy[i__ - 1];
00244 /* L10: */
00245     }
00246 
00247 /*     Test the error exits */
00248 
00249     if (*tsterr) {
00250         cerrvx_(path, nout);
00251     }
00252     infoc_1.infot = 0;
00253 
00254 /*     Set the block size and minimum block size for testing. */
00255 
00256     nb = 1;
00257     nbmin = 2;
00258     xlaenv_(&c__1, &nb);
00259     xlaenv_(&c__2, &nbmin);
00260 
00261 /*     Do for each value of N in NVAL */
00262 
00263     i__1 = *nn;
00264     for (in = 1; in <= i__1; ++in) {
00265         n = nval[in];
00266         lda = max(n,1);
00267         npp = n * (n + 1) / 2;
00268         *(unsigned char *)xtype = 'N';
00269         nimat = 10;
00270         if (n <= 0) {
00271             nimat = 1;
00272         }
00273 
00274         i__2 = nimat;
00275         for (imat = 1; imat <= i__2; ++imat) {
00276 
00277 /*           Do the tests only if DOTYPE( IMAT ) is true. */
00278 
00279             if (! dotype[imat]) {
00280                 goto L170;
00281             }
00282 
00283 /*           Skip types 3, 4, 5, or 6 if the matrix size is too small. */
00284 
00285             zerot = imat >= 3 && imat <= 6;
00286             if (zerot && n < imat - 2) {
00287                 goto L170;
00288             }
00289 
00290 /*           Do first for UPLO = 'U', then for UPLO = 'L' */
00291 
00292             for (iuplo = 1; iuplo <= 2; ++iuplo) {
00293                 if (iuplo == 1) {
00294                     *(unsigned char *)uplo = 'U';
00295                     *(unsigned char *)packit = 'C';
00296                 } else {
00297                     *(unsigned char *)uplo = 'L';
00298                     *(unsigned char *)packit = 'R';
00299                 }
00300 
00301 /*              Set up parameters with CLATB4 and generate a test matrix */
00302 /*              with CLATMS. */
00303 
00304                 clatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &mode, 
00305                         &cndnum, dist);
00306 
00307                 s_copy(srnamc_1.srnamt, "CLATMS", (ftnlen)32, (ftnlen)6);
00308                 clatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00309                         cndnum, &anorm, &kl, &ku, packit, &a[1], &lda, &work[
00310                         1], &info);
00311 
00312 /*              Check error code from CLATMS. */
00313 
00314                 if (info != 0) {
00315                     alaerh_(path, "CLATMS", &info, &c__0, uplo, &n, &n, &c_n1, 
00316                              &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00317                     goto L160;
00318                 }
00319 
00320 /*              For types 3-6, zero one or more rows and columns of the */
00321 /*              matrix to test that INFO is returned correctly. */
00322 
00323                 if (zerot) {
00324                     if (imat == 3) {
00325                         izero = 1;
00326                     } else if (imat == 4) {
00327                         izero = n;
00328                     } else {
00329                         izero = n / 2 + 1;
00330                     }
00331 
00332                     if (imat < 6) {
00333 
00334 /*                    Set row and column IZERO to zero. */
00335 
00336                         if (iuplo == 1) {
00337                             ioff = (izero - 1) * izero / 2;
00338                             i__3 = izero - 1;
00339                             for (i__ = 1; i__ <= i__3; ++i__) {
00340                                 i__4 = ioff + i__;
00341                                 a[i__4].r = 0.f, a[i__4].i = 0.f;
00342 /* L20: */
00343                             }
00344                             ioff += izero;
00345                             i__3 = n;
00346                             for (i__ = izero; i__ <= i__3; ++i__) {
00347                                 i__4 = ioff;
00348                                 a[i__4].r = 0.f, a[i__4].i = 0.f;
00349                                 ioff += i__;
00350 /* L30: */
00351                             }
00352                         } else {
00353                             ioff = izero;
00354                             i__3 = izero - 1;
00355                             for (i__ = 1; i__ <= i__3; ++i__) {
00356                                 i__4 = ioff;
00357                                 a[i__4].r = 0.f, a[i__4].i = 0.f;
00358                                 ioff = ioff + n - i__;
00359 /* L40: */
00360                             }
00361                             ioff -= izero;
00362                             i__3 = n;
00363                             for (i__ = izero; i__ <= i__3; ++i__) {
00364                                 i__4 = ioff + i__;
00365                                 a[i__4].r = 0.f, a[i__4].i = 0.f;
00366 /* L50: */
00367                             }
00368                         }
00369                     } else {
00370                         ioff = 0;
00371                         if (iuplo == 1) {
00372 
00373 /*                       Set the first IZERO rows and columns to zero. */
00374 
00375                             i__3 = n;
00376                             for (j = 1; j <= i__3; ++j) {
00377                                 i2 = min(j,izero);
00378                                 i__4 = i2;
00379                                 for (i__ = 1; i__ <= i__4; ++i__) {
00380                                     i__5 = ioff + i__;
00381                                     a[i__5].r = 0.f, a[i__5].i = 0.f;
00382 /* L60: */
00383                                 }
00384                                 ioff += j;
00385 /* L70: */
00386                             }
00387                         } else {
00388 
00389 /*                       Set the last IZERO rows and columns to zero. */
00390 
00391                             i__3 = n;
00392                             for (j = 1; j <= i__3; ++j) {
00393                                 i1 = max(j,izero);
00394                                 i__4 = n;
00395                                 for (i__ = i1; i__ <= i__4; ++i__) {
00396                                     i__5 = ioff + i__;
00397                                     a[i__5].r = 0.f, a[i__5].i = 0.f;
00398 /* L80: */
00399                                 }
00400                                 ioff = ioff + n - j;
00401 /* L90: */
00402                             }
00403                         }
00404                     }
00405                 } else {
00406                     izero = 0;
00407                 }
00408 
00409 /*              Set the imaginary part of the diagonals. */
00410 
00411                 if (iuplo == 1) {
00412                     claipd_(&n, &a[1], &c__2, &c__1);
00413                 } else {
00414                     claipd_(&n, &a[1], &n, &c_n1);
00415                 }
00416 
00417                 for (ifact = 1; ifact <= 2; ++ifact) {
00418 
00419 /*                 Do first for FACT = 'F', then for other values. */
00420 
00421                     *(unsigned char *)fact = *(unsigned char *)&facts[ifact - 
00422                             1];
00423 
00424 /*                 Compute the condition number for comparison with */
00425 /*                 the value returned by CHPSVX. */
00426 
00427                     if (zerot) {
00428                         if (ifact == 1) {
00429                             goto L150;
00430                         }
00431                         rcondc = 0.f;
00432 
00433                     } else if (ifact == 1) {
00434 
00435 /*                    Compute the 1-norm of A. */
00436 
00437                         anorm = clanhp_("1", uplo, &n, &a[1], &rwork[1]);
00438 
00439 /*                    Factor the matrix A. */
00440 
00441                         ccopy_(&npp, &a[1], &c__1, &afac[1], &c__1);
00442                         chptrf_(uplo, &n, &afac[1], &iwork[1], &info);
00443 
00444 /*                    Compute inv(A) and take its norm. */
00445 
00446                         ccopy_(&npp, &afac[1], &c__1, &ainv[1], &c__1);
00447                         chptri_(uplo, &n, &ainv[1], &iwork[1], &work[1], &
00448                                 info);
00449                         ainvnm = clanhp_("1", uplo, &n, &ainv[1], &rwork[1]);
00450 
00451 /*                    Compute the 1-norm condition number of A. */
00452 
00453                         if (anorm <= 0.f || ainvnm <= 0.f) {
00454                             rcondc = 1.f;
00455                         } else {
00456                             rcondc = 1.f / anorm / ainvnm;
00457                         }
00458                     }
00459 
00460 /*                 Form an exact solution and set the right hand side. */
00461 
00462                     s_copy(srnamc_1.srnamt, "CLARHS", (ftnlen)32, (ftnlen)6);
00463                     clarhs_(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 CHPSV  --- */
00469 
00470                     if (ifact == 2) {
00471                         ccopy_(&npp, &a[1], &c__1, &afac[1], &c__1);
00472                         clacpy_("Full", &n, nrhs, &b[1], &lda, &x[1], &lda);
00473 
00474 /*                    Factor the matrix and solve the system using CHPSV. */
00475 
00476                         s_copy(srnamc_1.srnamt, "CHPSV ", (ftnlen)32, (ftnlen)
00477                                 6);
00478                         chpsv_(uplo, &n, nrhs, &afac[1], &iwork[1], &x[1], &
00479                                 lda, &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 CHPSV . */
00499 
00500                         if (info != k) {
00501                             alaerh_(path, "CHPSV ", &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                         chpt01_(uplo, &n, &a[1], &afac[1], &iwork[1], &ainv[1]
00513 , &lda, &rwork[1], result);
00514 
00515 /*                    Compute residual of the computed solution. */
00516 
00517                         clacpy_("Full", &n, nrhs, &b[1], &lda, &work[1], &lda);
00518                         cppt02_(uplo, &n, nrhs, &a[1], &x[1], &lda, &work[1], 
00519                                 &lda, &rwork[1], &result[1]);
00520 
00521 /*                    Check solution from generated exact solution. */
00522 
00523                         cget04_(&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, "CHPSV ", (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(real));
00548                                 e_wsfe();
00549                                 ++nfail;
00550                             }
00551 /* L110: */
00552                         }
00553                         nrun += nt;
00554 L120:
00555                         ;
00556                     }
00557 
00558 /*                 --- Test CHPSVX --- */
00559 
00560                     if (ifact == 2 && npp > 0) {
00561                         claset_("Full", &npp, &c__1, &c_b64, &c_b64, &afac[1], 
00562                                  &npp);
00563                     }
00564                     claset_("Full", &n, nrhs, &c_b64, &c_b64, &x[1], &lda);
00565 
00566 /*                 Solve the system and compute the condition number and */
00567 /*                 error bounds using CHPSVX. */
00568 
00569                     s_copy(srnamc_1.srnamt, "CHPSVX", (ftnlen)32, (ftnlen)6);
00570                     chpsvx_(fact, uplo, &n, nrhs, &a[1], &afac[1], &iwork[1], 
00571                             &b[1], &lda, &x[1], &lda, &rcond, &rwork[1], &
00572                             rwork[*nrhs + 1], &work[1], &rwork[(*nrhs << 1) + 
00573                             1], &info);
00574 
00575 /*                 Adjust the expected value of INFO to account for */
00576 /*                 pivoting. */
00577 
00578                     k = izero;
00579                     if (k > 0) {
00580 L130:
00581                         if (iwork[k] < 0) {
00582                             if (iwork[k] != -k) {
00583                                 k = -iwork[k];
00584                                 goto L130;
00585                             }
00586                         } else if (iwork[k] != k) {
00587                             k = iwork[k];
00588                             goto L130;
00589                         }
00590                     }
00591 
00592 /*                 Check the error code from CHPSVX. */
00593 
00594                     if (info != k) {
00595 /* Writing concatenation */
00596                         i__6[0] = 1, a__1[0] = fact;
00597                         i__6[1] = 1, a__1[1] = uplo;
00598                         s_cat(ch__1, a__1, i__6, &c__2, (ftnlen)2);
00599                         alaerh_(path, "CHPSVX", &info, &k, ch__1, &n, &n, &
00600                                 c_n1, &c_n1, nrhs, &imat, &nfail, &nerrs, 
00601                                 nout);
00602                         goto L150;
00603                     }
00604 
00605                     if (info == 0) {
00606                         if (ifact >= 2) {
00607 
00608 /*                       Reconstruct matrix from factors and compute */
00609 /*                       residual. */
00610 
00611                             chpt01_(uplo, &n, &a[1], &afac[1], &iwork[1], &
00612                                     ainv[1], &lda, &rwork[(*nrhs << 1) + 1], 
00613                                     result);
00614                             k1 = 1;
00615                         } else {
00616                             k1 = 2;
00617                         }
00618 
00619 /*                    Compute residual of the computed solution. */
00620 
00621                         clacpy_("Full", &n, nrhs, &b[1], &lda, &work[1], &lda);
00622                         cppt02_(uplo, &n, nrhs, &a[1], &x[1], &lda, &work[1], 
00623                                 &lda, &rwork[(*nrhs << 1) + 1], &result[1]);
00624 
00625 /*                    Check solution from generated exact solution. */
00626 
00627                         cget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda, &
00628                                 rcondc, &result[2]);
00629 
00630 /*                    Check the error bounds from iterative refinement. */
00631 
00632                         cppt05_(uplo, &n, nrhs, &a[1], &b[1], &lda, &x[1], &
00633                                 lda, &xact[1], &lda, &rwork[1], &rwork[*nrhs 
00634                                 + 1], &result[3]);
00635                     } else {
00636                         k1 = 6;
00637                     }
00638 
00639 /*                 Compare RCOND from CHPSVX with the computed value */
00640 /*                 in RCONDC. */
00641 
00642                     result[5] = sget06_(&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, "CHPSVX", (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(real));
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 CDRVHP */
00692 
00693 } /* cdrvhp_ */


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