zchkhp.c
Go to the documentation of this file.
00001 /* zchkhp.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__0 = 0;
00034 static integer c_n1 = -1;
00035 static integer c__2 = 2;
00036 static integer c__1 = 1;
00037 static integer c__8 = 8;
00038 
00039 /* Subroutine */ int zchkhp_(logical *dotype, integer *nn, integer *nval, 
00040         integer *nns, integer *nsval, doublereal *thresh, logical *tsterr, 
00041         integer *nmax, doublecomplex *a, doublecomplex *afac, doublecomplex *
00042         ainv, 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 
00050     /* Format strings */
00051     static char fmt_9999[] = "(\002 UPLO = '\002,a1,\002', N =\002,i5,\002, "
00052             "type \002,i2,\002, test \002,i2,\002, ratio =\002,g12.5)";
00053     static char fmt_9998[] = "(\002 UPLO = '\002,a1,\002', N =\002,i5,\002, "
00054             "NRHS=\002,i3,\002, type \002,i2,\002, test(\002,i2,\002) =\002,g"
00055             "12.5)";
00056 
00057     /* System generated locals */
00058     integer i__1, i__2, i__3, i__4, i__5;
00059 
00060     /* Builtin functions */
00061     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00062     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00063 
00064     /* Local variables */
00065     integer i__, j, k, n, i1, i2, in, kl, ku, nt, lda, npp, ioff, mode, imat, 
00066             info;
00067     char path[3], dist[1];
00068     integer irhs, nrhs;
00069     char uplo[1], type__[1];
00070     integer nrun;
00071     extern /* Subroutine */ int alahd_(integer *, char *);
00072     integer nfail, iseed[4];
00073     extern doublereal dget06_(doublereal *, doublereal *);
00074     extern logical lsame_(char *, char *);
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 *), zppt03_(char *, 
00086             integer *, doublecomplex *, doublecomplex *, doublecomplex *, 
00087             integer *, doublereal *, doublereal *, doublereal *);
00088     logical zerot;
00089     extern /* Subroutine */ int zcopy_(integer *, doublecomplex *, integer *, 
00090             doublecomplex *, integer *), zppt05_(char *, integer *, integer *, 
00091              doublecomplex *, doublecomplex *, integer *, doublecomplex *, 
00092             integer *, doublecomplex *, integer *, doublereal *, doublereal *, 
00093              doublereal *);
00094     char xtype[1];
00095     extern /* Subroutine */ int zlatb4_(char *, integer *, integer *, integer 
00096             *, char *, integer *, integer *, doublereal *, integer *, 
00097             doublereal *, char *), alaerh_(char *, 
00098             char *, integer *, integer *, char *, integer *, integer *, 
00099             integer *, integer *, integer *, integer *, integer *, integer *, 
00100             integer *);
00101     doublereal rcondc;
00102     char packit[1];
00103     extern /* Subroutine */ int alasum_(char *, integer *, integer *, integer 
00104             *, integer *);
00105     doublereal cndnum;
00106     extern /* Subroutine */ int zlaipd_(integer *, doublecomplex *, integer *, 
00107              integer *);
00108     logical trfcon;
00109     extern doublereal zlanhp_(char *, char *, integer *, doublecomplex *, 
00110             doublereal *);
00111     extern /* Subroutine */ int zhpcon_(char *, integer *, doublecomplex *, 
00112             integer *, doublereal *, doublereal *, doublecomplex *, integer *), zlacpy_(char *, integer *, integer *, doublecomplex *, 
00113             integer *, doublecomplex *, integer *), zlarhs_(char *, 
00114             char *, char *, char *, integer *, integer *, integer *, integer *
00115 , integer *, doublecomplex *, integer *, doublecomplex *, integer 
00116             *, doublecomplex *, integer *, integer *, integer *), zlatms_(integer *, integer *, char *, 
00117             integer *, char *, doublereal *, integer *, doublereal *, 
00118             doublereal *, integer *, integer *, char *, doublecomplex *, 
00119             integer *, doublecomplex *, integer *), 
00120             zhprfs_(char *, integer *, integer *, doublecomplex *, 
00121             doublecomplex *, integer *, doublecomplex *, integer *, 
00122             doublecomplex *, integer *, doublereal *, doublereal *, 
00123             doublecomplex *, doublereal *, integer *), zhptrf_(char *, 
00124              integer *, doublecomplex *, integer *, integer *);
00125     doublereal result[8];
00126     extern /* Subroutine */ int zhptri_(char *, integer *, doublecomplex *, 
00127             integer *, doublecomplex *, integer *), zhptrs_(char *, 
00128             integer *, integer *, doublecomplex *, integer *, doublecomplex *, 
00129              integer *, integer *), zerrsy_(char *, integer *)
00130             ;
00131 
00132     /* Fortran I/O blocks */
00133     static cilist io___38 = { 0, 0, 0, fmt_9999, 0 };
00134     static cilist io___41 = { 0, 0, 0, fmt_9998, 0 };
00135     static cilist io___43 = { 0, 0, 0, fmt_9999, 0 };
00136 
00137 
00138 
00139 /*  -- LAPACK test routine (version 3.1) -- */
00140 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00141 /*     November 2006 */
00142 
00143 /*     .. Scalar Arguments .. */
00144 /*     .. */
00145 /*     .. Array Arguments .. */
00146 /*     .. */
00147 
00148 /*  Purpose */
00149 /*  ======= */
00150 
00151 /*  ZCHKHP tests ZHPTRF, -TRI, -TRS, -RFS, and -CON */
00152 
00153 /*  Arguments */
00154 /*  ========= */
00155 
00156 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00157 /*          The matrix types to be used for testing.  Matrices of type j */
00158 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00159 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00160 
00161 /*  NN      (input) INTEGER */
00162 /*          The number of values of N contained in the vector NVAL. */
00163 
00164 /*  NVAL    (input) INTEGER array, dimension (NN) */
00165 /*          The values of the matrix dimension N. */
00166 
00167 /*  NNS     (input) INTEGER */
00168 /*          The number of values of NRHS contained in the vector NSVAL. */
00169 
00170 /*  NSVAL   (input) INTEGER array, dimension (NNS) */
00171 /*          The values of the number of right hand sides NRHS. */
00172 
00173 /*  THRESH  (input) DOUBLE PRECISION */
00174 /*          The threshold value for the test ratios.  A result is */
00175 /*          included in the output file if RESULT >= THRESH.  To have */
00176 /*          every test ratio printed, use THRESH = 0. */
00177 
00178 /*  TSTERR  (input) LOGICAL */
00179 /*          Flag that indicates whether error exits are to be tested. */
00180 
00181 /*  NMAX    (input) INTEGER */
00182 /*          The maximum value permitted for N, used in dimensioning the */
00183 /*          work arrays. */
00184 
00185 /*  A       (workspace) COMPLEX*16 array, dimension */
00186 /*                      (NMAX*(NMAX+1)/2) */
00187 
00188 /*  AFAC    (workspace) COMPLEX*16 array, dimension */
00189 /*                      (NMAX*(NMAX+1)/2) */
00190 
00191 /*  AINV    (workspace) COMPLEX*16 array, dimension */
00192 /*                      (NMAX*(NMAX+1)/2) */
00193 
00194 /*  B       (workspace) COMPLEX*16 array, dimension (NMAX*NSMAX) */
00195 /*          where NSMAX is the largest entry in NSVAL. */
00196 
00197 /*  X       (workspace) COMPLEX*16 array, dimension (NMAX*NSMAX) */
00198 
00199 /*  XACT    (workspace) COMPLEX*16 array, dimension (NMAX*NSMAX) */
00200 
00201 /*  WORK    (workspace) COMPLEX*16 array, dimension */
00202 /*                      (NMAX*max(2,NSMAX)) */
00203 
00204 /*  RWORK   (workspace) DOUBLE PRECISION array, */
00205 /*                                 dimension (NMAX+2*NSMAX) */
00206 
00207 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00208 
00209 /*  NOUT    (input) INTEGER */
00210 /*          The unit number for output. */
00211 
00212 /*  ===================================================================== */
00213 
00214 /*     .. Parameters .. */
00215 /*     .. */
00216 /*     .. Local Scalars .. */
00217 /*     .. */
00218 /*     .. Local Arrays .. */
00219 /*     .. */
00220 /*     .. External Functions .. */
00221 /*     .. */
00222 /*     .. External Subroutines .. */
00223 /*     .. */
00224 /*     .. Intrinsic Functions .. */
00225 /*     .. */
00226 /*     .. Scalars in Common .. */
00227 /*     .. */
00228 /*     .. Common blocks .. */
00229 /*     .. */
00230 /*     .. Data statements .. */
00231     /* Parameter adjustments */
00232     --iwork;
00233     --rwork;
00234     --work;
00235     --xact;
00236     --x;
00237     --b;
00238     --ainv;
00239     --afac;
00240     --a;
00241     --nsval;
00242     --nval;
00243     --dotype;
00244 
00245     /* Function Body */
00246 /*     .. */
00247 /*     .. Executable Statements .. */
00248 
00249 /*     Initialize constants and the random number seed. */
00250 
00251     s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00252     s_copy(path + 1, "HP", (ftnlen)2, (ftnlen)2);
00253     nrun = 0;
00254     nfail = 0;
00255     nerrs = 0;
00256     for (i__ = 1; i__ <= 4; ++i__) {
00257         iseed[i__ - 1] = iseedy[i__ - 1];
00258 /* L10: */
00259     }
00260 
00261 /*     Test the error exits */
00262 
00263     if (*tsterr) {
00264         zerrsy_(path, nout);
00265     }
00266     infoc_1.infot = 0;
00267 
00268 /*     Do for each value of N in NVAL */
00269 
00270     i__1 = *nn;
00271     for (in = 1; in <= i__1; ++in) {
00272         n = nval[in];
00273         lda = max(n,1);
00274         *(unsigned char *)xtype = 'N';
00275         nimat = 10;
00276         if (n <= 0) {
00277             nimat = 1;
00278         }
00279 
00280         izero = 0;
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 L160;
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 L160;
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                 if (lsame_(uplo, "U")) {
00302                     *(unsigned char *)packit = 'C';
00303                 } else {
00304                     *(unsigned char *)packit = 'R';
00305                 }
00306 
00307 /*              Set up parameters with ZLATB4 and generate a test matrix */
00308 /*              with ZLATMS. */
00309 
00310                 zlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &mode, 
00311                         &cndnum, dist);
00312 
00313                 s_copy(srnamc_1.srnamt, "ZLATMS", (ftnlen)32, (ftnlen)6);
00314                 zlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00315                         cndnum, &anorm, &kl, &ku, packit, &a[1], &lda, &work[
00316                         1], &info);
00317 
00318 /*              Check error code from ZLATMS. */
00319 
00320                 if (info != 0) {
00321                     alaerh_(path, "ZLATMS", &info, &c__0, uplo, &n, &n, &c_n1, 
00322                              &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00323                     goto L150;
00324                 }
00325 
00326 /*              For types 3-6, zero one or more rows and columns of */
00327 /*              the matrix to test that INFO is returned correctly. */
00328 
00329                 if (zerot) {
00330                     if (imat == 3) {
00331                         izero = 1;
00332                     } else if (imat == 4) {
00333                         izero = n;
00334                     } else {
00335                         izero = n / 2 + 1;
00336                     }
00337 
00338                     if (imat < 6) {
00339 
00340 /*                    Set row and column IZERO to zero. */
00341 
00342                         if (iuplo == 1) {
00343                             ioff = (izero - 1) * izero / 2;
00344                             i__3 = izero - 1;
00345                             for (i__ = 1; i__ <= i__3; ++i__) {
00346                                 i__4 = ioff + i__;
00347                                 a[i__4].r = 0., a[i__4].i = 0.;
00348 /* L20: */
00349                             }
00350                             ioff += izero;
00351                             i__3 = n;
00352                             for (i__ = izero; i__ <= i__3; ++i__) {
00353                                 i__4 = ioff;
00354                                 a[i__4].r = 0., a[i__4].i = 0.;
00355                                 ioff += i__;
00356 /* L30: */
00357                             }
00358                         } else {
00359                             ioff = izero;
00360                             i__3 = izero - 1;
00361                             for (i__ = 1; i__ <= i__3; ++i__) {
00362                                 i__4 = ioff;
00363                                 a[i__4].r = 0., a[i__4].i = 0.;
00364                                 ioff = ioff + n - i__;
00365 /* L40: */
00366                             }
00367                             ioff -= izero;
00368                             i__3 = n;
00369                             for (i__ = izero; i__ <= i__3; ++i__) {
00370                                 i__4 = ioff + i__;
00371                                 a[i__4].r = 0., a[i__4].i = 0.;
00372 /* L50: */
00373                             }
00374                         }
00375                     } else {
00376                         ioff = 0;
00377                         if (iuplo == 1) {
00378 
00379 /*                       Set the first IZERO rows and columns to zero. */
00380 
00381                             i__3 = n;
00382                             for (j = 1; j <= i__3; ++j) {
00383                                 i2 = min(j,izero);
00384                                 i__4 = i2;
00385                                 for (i__ = 1; i__ <= i__4; ++i__) {
00386                                     i__5 = ioff + i__;
00387                                     a[i__5].r = 0., a[i__5].i = 0.;
00388 /* L60: */
00389                                 }
00390                                 ioff += j;
00391 /* L70: */
00392                             }
00393                         } else {
00394 
00395 /*                       Set the last IZERO rows and columns to zero. */
00396 
00397                             i__3 = n;
00398                             for (j = 1; j <= i__3; ++j) {
00399                                 i1 = max(j,izero);
00400                                 i__4 = n;
00401                                 for (i__ = i1; i__ <= i__4; ++i__) {
00402                                     i__5 = ioff + i__;
00403                                     a[i__5].r = 0., a[i__5].i = 0.;
00404 /* L80: */
00405                                 }
00406                                 ioff = ioff + n - j;
00407 /* L90: */
00408                             }
00409                         }
00410                     }
00411                 } else {
00412                     izero = 0;
00413                 }
00414 
00415 /*              Set the imaginary part of the diagonals. */
00416 
00417                 if (iuplo == 1) {
00418                     zlaipd_(&n, &a[1], &c__2, &c__1);
00419                 } else {
00420                     zlaipd_(&n, &a[1], &n, &c_n1);
00421                 }
00422 
00423 /*              Compute the L*D*L' or U*D*U' factorization of the matrix. */
00424 
00425                 npp = n * (n + 1) / 2;
00426                 zcopy_(&npp, &a[1], &c__1, &afac[1], &c__1);
00427                 s_copy(srnamc_1.srnamt, "ZHPTRF", (ftnlen)32, (ftnlen)6);
00428                 zhptrf_(uplo, &n, &afac[1], &iwork[1], &info);
00429 
00430 /*              Adjust the expected value of INFO to account for */
00431 /*              pivoting. */
00432 
00433                 k = izero;
00434                 if (k > 0) {
00435 L100:
00436                     if (iwork[k] < 0) {
00437                         if (iwork[k] != -k) {
00438                             k = -iwork[k];
00439                             goto L100;
00440                         }
00441                     } else if (iwork[k] != k) {
00442                         k = iwork[k];
00443                         goto L100;
00444                     }
00445                 }
00446 
00447 /*              Check error code from ZHPTRF. */
00448 
00449                 if (info != k) {
00450                     alaerh_(path, "ZHPTRF", &info, &k, uplo, &n, &n, &c_n1, &
00451                             c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00452                 }
00453                 if (info != 0) {
00454                     trfcon = TRUE_;
00455                 } else {
00456                     trfcon = FALSE_;
00457                 }
00458 
00459 /* +    TEST 1 */
00460 /*              Reconstruct matrix from factors and compute residual. */
00461 
00462                 zhpt01_(uplo, &n, &a[1], &afac[1], &iwork[1], &ainv[1], &lda, 
00463                         &rwork[1], result);
00464                 nt = 1;
00465 
00466 /* +    TEST 2 */
00467 /*              Form the inverse and compute the residual. */
00468 
00469                 if (! trfcon) {
00470                     zcopy_(&npp, &afac[1], &c__1, &ainv[1], &c__1);
00471                     s_copy(srnamc_1.srnamt, "ZHPTRI", (ftnlen)32, (ftnlen)6);
00472                     zhptri_(uplo, &n, &ainv[1], &iwork[1], &work[1], &info);
00473 
00474 /*              Check error code from ZHPTRI. */
00475 
00476                     if (info != 0) {
00477                         alaerh_(path, "ZHPTRI", &info, &c__0, uplo, &n, &n, &
00478                                 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs, 
00479                                 nout);
00480                     }
00481 
00482                     zppt03_(uplo, &n, &a[1], &ainv[1], &work[1], &lda, &rwork[
00483                             1], &rcondc, &result[1]);
00484                     nt = 2;
00485                 }
00486 
00487 /*              Print information about the tests that did not pass */
00488 /*              the threshold. */
00489 
00490                 i__3 = nt;
00491                 for (k = 1; k <= i__3; ++k) {
00492                     if (result[k - 1] >= *thresh) {
00493                         if (nfail == 0 && nerrs == 0) {
00494                             alahd_(nout, path);
00495                         }
00496                         io___38.ciunit = *nout;
00497                         s_wsfe(&io___38);
00498                         do_fio(&c__1, uplo, (ftnlen)1);
00499                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00500                         do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00501                         do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
00502                         do_fio(&c__1, (char *)&result[k - 1], (ftnlen)sizeof(
00503                                 doublereal));
00504                         e_wsfe();
00505                         ++nfail;
00506                     }
00507 /* L110: */
00508                 }
00509                 nrun += nt;
00510 
00511 /*              Do only the condition estimate if INFO is not 0. */
00512 
00513                 if (trfcon) {
00514                     rcondc = 0.;
00515                     goto L140;
00516                 }
00517 
00518                 i__3 = *nns;
00519                 for (irhs = 1; irhs <= i__3; ++irhs) {
00520                     nrhs = nsval[irhs];
00521 
00522 /* +    TEST 3 */
00523 /*              Solve and compute residual for  A * X = B. */
00524 
00525                     s_copy(srnamc_1.srnamt, "ZLARHS", (ftnlen)32, (ftnlen)6);
00526                     zlarhs_(path, xtype, uplo, " ", &n, &n, &kl, &ku, &nrhs, &
00527                             a[1], &lda, &xact[1], &lda, &b[1], &lda, iseed, &
00528                             info);
00529                     *(unsigned char *)xtype = 'C';
00530                     zlacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &lda);
00531 
00532                     s_copy(srnamc_1.srnamt, "ZHPTRS", (ftnlen)32, (ftnlen)6);
00533                     zhptrs_(uplo, &n, &nrhs, &afac[1], &iwork[1], &x[1], &lda, 
00534                              &info);
00535 
00536 /*              Check error code from ZHPTRS. */
00537 
00538                     if (info != 0) {
00539                         alaerh_(path, "ZHPTRS", &info, &c__0, uplo, &n, &n, &
00540                                 c_n1, &c_n1, &nrhs, &imat, &nfail, &nerrs, 
00541                                 nout);
00542                     }
00543 
00544                     zlacpy_("Full", &n, &nrhs, &b[1], &lda, &work[1], &lda);
00545                     zppt02_(uplo, &n, &nrhs, &a[1], &x[1], &lda, &work[1], &
00546                             lda, &rwork[1], &result[2]);
00547 
00548 /* +    TEST 4 */
00549 /*              Check solution from generated exact solution. */
00550 
00551                     zget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &rcondc, &
00552                             result[3]);
00553 
00554 /* +    TESTS 5, 6, and 7 */
00555 /*              Use iterative refinement to improve the solution. */
00556 
00557                     s_copy(srnamc_1.srnamt, "ZHPRFS", (ftnlen)32, (ftnlen)6);
00558                     zhprfs_(uplo, &n, &nrhs, &a[1], &afac[1], &iwork[1], &b[1]
00559 , &lda, &x[1], &lda, &rwork[1], &rwork[nrhs + 1], 
00560                             &work[1], &rwork[(nrhs << 1) + 1], &info);
00561 
00562 /*              Check error code from ZHPRFS. */
00563 
00564                     if (info != 0) {
00565                         alaerh_(path, "ZHPRFS", &info, &c__0, uplo, &n, &n, &
00566                                 c_n1, &c_n1, &nrhs, &imat, &nfail, &nerrs, 
00567                                 nout);
00568                     }
00569 
00570                     zget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &rcondc, &
00571                             result[4]);
00572                     zppt05_(uplo, &n, &nrhs, &a[1], &b[1], &lda, &x[1], &lda, 
00573                             &xact[1], &lda, &rwork[1], &rwork[nrhs + 1], &
00574                             result[5]);
00575 
00576 /*                 Print information about the tests that did not pass */
00577 /*                 the threshold. */
00578 
00579                     for (k = 3; k <= 7; ++k) {
00580                         if (result[k - 1] >= *thresh) {
00581                             if (nfail == 0 && nerrs == 0) {
00582                                 alahd_(nout, path);
00583                             }
00584                             io___41.ciunit = *nout;
00585                             s_wsfe(&io___41);
00586                             do_fio(&c__1, uplo, (ftnlen)1);
00587                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00588                                     ;
00589                             do_fio(&c__1, (char *)&nrhs, (ftnlen)sizeof(
00590                                     integer));
00591                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00592                                     integer));
00593                             do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer))
00594                                     ;
00595                             do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00596                                     sizeof(doublereal));
00597                             e_wsfe();
00598                             ++nfail;
00599                         }
00600 /* L120: */
00601                     }
00602                     nrun += 5;
00603 /* L130: */
00604                 }
00605 
00606 /* +    TEST 8 */
00607 /*              Get an estimate of RCOND = 1/CNDNUM. */
00608 
00609 L140:
00610                 anorm = zlanhp_("1", uplo, &n, &a[1], &rwork[1]);
00611                 s_copy(srnamc_1.srnamt, "ZHPCON", (ftnlen)32, (ftnlen)6);
00612                 zhpcon_(uplo, &n, &afac[1], &iwork[1], &anorm, &rcond, &work[
00613                         1], &info);
00614 
00615 /*              Check error code from ZHPCON. */
00616 
00617                 if (info != 0) {
00618                     alaerh_(path, "ZHPCON", &info, &c__0, uplo, &n, &n, &c_n1, 
00619                              &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00620                 }
00621 
00622                 result[7] = dget06_(&rcond, &rcondc);
00623 
00624 /*              Print the test ratio if it is .GE. THRESH. */
00625 
00626                 if (result[7] >= *thresh) {
00627                     if (nfail == 0 && nerrs == 0) {
00628                         alahd_(nout, path);
00629                     }
00630                     io___43.ciunit = *nout;
00631                     s_wsfe(&io___43);
00632                     do_fio(&c__1, uplo, (ftnlen)1);
00633                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00634                     do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00635                     do_fio(&c__1, (char *)&c__8, (ftnlen)sizeof(integer));
00636                     do_fio(&c__1, (char *)&result[7], (ftnlen)sizeof(
00637                             doublereal));
00638                     e_wsfe();
00639                     ++nfail;
00640                 }
00641                 ++nrun;
00642 L150:
00643                 ;
00644             }
00645 L160:
00646             ;
00647         }
00648 /* L170: */
00649     }
00650 
00651 /*     Print a summary of the results. */
00652 
00653     alasum_(path, nout, &nfail, &nrun, &nerrs);
00654 
00655     return 0;
00656 
00657 /*     End of ZCHKHP */
00658 
00659 } /* zchkhp_ */


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