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


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