cchkpb.c
Go to the documentation of this file.
00001 /* cchkpb.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__1 = 1;
00036 static complex c_b50 = {0.f,0.f};
00037 static complex c_b51 = {1.f,0.f};
00038 static integer c__7 = 7;
00039 
00040 /* Subroutine */ int cchkpb_(logical *dotype, integer *nn, integer *nval, 
00041         integer *nnb, integer *nbval, integer *nns, integer *nsval, real *
00042         thresh, logical *tsterr, integer *nmax, complex *a, complex *afac, 
00043         complex *ainv, complex *b, complex *x, complex *xact, complex *work, 
00044         real *rwork, integer *nout)
00045 {
00046     /* Initialized data */
00047 
00048     static integer iseedy[4] = { 1988,1989,1990,1991 };
00049 
00050     /* Format strings */
00051     static char fmt_9999[] = "(\002 UPLO='\002,a1,\002', N=\002,i5,\002, KD"
00052             "=\002,i5,\002, NB=\002,i4,\002, type \002,i2,\002, test \002,i2"
00053             ",\002, ratio= \002,g12.5)";
00054     static char fmt_9998[] = "(\002 UPLO='\002,a1,\002', N=\002,i5,\002, KD"
00055             "=\002,i5,\002, NRHS=\002,i3,\002, type \002,i2,\002, test(\002,i"
00056             "2,\002) = \002,g12.5)";
00057     static char fmt_9997[] = "(\002 UPLO='\002,a1,\002', N=\002,i5,\002, KD"
00058             "=\002,i5,\002,\002,10x,\002 type \002,i2,\002, test(\002,i2,\002"
00059             ") = \002,g12.5)";
00060 
00061     /* System generated locals */
00062     integer i__1, i__2, i__3, i__4, i__5, i__6;
00063 
00064     /* Builtin functions */
00065     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00066     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00067 
00068     /* Local variables */
00069     integer i__, k, n, i1, i2, kd, nb, in, kl, iw, ku, lda, ikd, inb, nkd, 
00070             ldab, ioff, mode, koff, imat, info;
00071     char path[3], dist[1];
00072     integer irhs, nrhs;
00073     char uplo[1], type__[1];
00074     integer nrun;
00075     extern /* Subroutine */ int alahd_(integer *, char *), cget04_(
00076             integer *, integer *, complex *, integer *, complex *, integer *, 
00077             real *, real *);
00078     integer nfail, iseed[4];
00079     extern /* Subroutine */ int cpbt01_(char *, integer *, integer *, complex 
00080             *, integer *, complex *, integer *, real *, real *), 
00081             cpbt02_(char *, integer *, integer *, integer *, complex *, 
00082             integer *, complex *, integer *, complex *, integer *, real *, 
00083             real *), cpbt05_(char *, integer *, integer *, integer *, 
00084             complex *, integer *, complex *, integer *, complex *, integer *, 
00085             complex *, integer *, real *, real *, real *);
00086     integer kdval[4];
00087     real rcond;
00088     integer nimat;
00089     extern doublereal sget06_(real *, real *);
00090     real anorm;
00091     extern /* Subroutine */ int ccopy_(integer *, complex *, integer *, 
00092             complex *, integer *), cswap_(integer *, complex *, integer *, 
00093             complex *, integer *);
00094     integer iuplo, izero, nerrs;
00095     logical zerot;
00096     char xtype[1];
00097     extern /* Subroutine */ int clatb4_(char *, integer *, integer *, integer 
00098             *, char *, integer *, integer *, real *, integer *, real *, char *
00099 );
00100     extern doublereal clanhb_(char *, char *, integer *, integer *, complex *, 
00101              integer *, real *), clange_(char *, integer *, 
00102             integer *, complex *, integer *, real *);
00103     extern /* Subroutine */ int alaerh_(char *, char *, integer *, integer *, 
00104             char *, integer *, integer *, integer *, integer *, integer *, 
00105             integer *, integer *, integer *, integer *), claipd_(integer *, complex *, integer *, integer *), 
00106             cpbcon_(char *, integer *, integer *, complex *, integer *, real *
00107 , real *, complex *, real *, integer *);
00108     real rcondc;
00109     char packit[1];
00110     extern /* Subroutine */ int clacpy_(char *, integer *, integer *, complex 
00111             *, integer *, complex *, integer *), clarhs_(char *, char 
00112             *, char *, char *, integer *, integer *, integer *, integer *, 
00113             integer *, complex *, integer *, complex *, integer *, complex *, 
00114             integer *, integer *, integer *), 
00115             claset_(char *, integer *, integer *, complex *, complex *, 
00116             complex *, integer *), cpbrfs_(char *, integer *, integer 
00117             *, integer *, complex *, integer *, complex *, integer *, complex 
00118             *, integer *, complex *, integer *, real *, real *, complex *, 
00119             real *, integer *), cpbtrf_(char *, integer *, integer *, 
00120             complex *, integer *, integer *), alasum_(char *, integer 
00121             *, integer *, integer *, integer *);
00122     real cndnum;
00123     extern /* Subroutine */ int clatms_(integer *, integer *, char *, integer 
00124             *, char *, real *, integer *, real *, real *, integer *, integer *
00125 , char *, complex *, integer *, complex *, integer *);
00126     real ainvnm;
00127     extern /* Subroutine */ int cerrpo_(char *, integer *), cpbtrs_(
00128             char *, integer *, integer *, integer *, complex *, integer *, 
00129             complex *, integer *, integer *), xlaenv_(integer *, 
00130             integer *);
00131     real result[7];
00132 
00133     /* Fortran I/O blocks */
00134     static cilist io___40 = { 0, 0, 0, fmt_9999, 0 };
00135     static cilist io___46 = { 0, 0, 0, fmt_9998, 0 };
00136     static cilist io___48 = { 0, 0, 0, fmt_9997, 0 };
00137 
00138 
00139 
00140 /*  -- LAPACK test routine (version 3.1) -- */
00141 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00142 /*     November 2006 */
00143 
00144 /*     .. Scalar Arguments .. */
00145 /*     .. */
00146 /*     .. Array Arguments .. */
00147 /*     .. */
00148 
00149 /*  Purpose */
00150 /*  ======= */
00151 
00152 /*  CCHKPB tests CPBTRF, -TRS, -RFS, and -CON. */
00153 
00154 /*  Arguments */
00155 /*  ========= */
00156 
00157 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00158 /*          The matrix types to be used for testing.  Matrices of type j */
00159 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00160 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00161 
00162 /*  NN      (input) INTEGER */
00163 /*          The number of values of N contained in the vector NVAL. */
00164 
00165 /*  NVAL    (input) INTEGER array, dimension (NN) */
00166 /*          The values of the matrix dimension N. */
00167 
00168 /*  NNB     (input) INTEGER */
00169 /*          The number of values of NB contained in the vector NBVAL. */
00170 
00171 /*  NBVAL   (input) INTEGER array, dimension (NBVAL) */
00172 /*          The values of the blocksize NB. */
00173 
00174 /*  NNS     (input) INTEGER */
00175 /*          The number of values of NRHS contained in the vector NSVAL. */
00176 
00177 /*  NSVAL   (input) INTEGER array, dimension (NNS) */
00178 /*          The values of the number of right hand sides NRHS. */
00179 
00180 /*  THRESH  (input) REAL */
00181 /*          The threshold value for the test ratios.  A result is */
00182 /*          included in the output file if RESULT >= THRESH.  To have */
00183 /*          every test ratio printed, use THRESH = 0. */
00184 
00185 /*  TSTERR  (input) LOGICAL */
00186 /*          Flag that indicates whether error exits are to be tested. */
00187 
00188 /*  NMAX    (input) INTEGER */
00189 /*          The maximum value permitted for N, used in dimensioning the */
00190 /*          work arrays. */
00191 
00192 /*  A       (workspace) REAL array, dimension (NMAX*NMAX) */
00193 
00194 /*  AFAC    (workspace) REAL array, dimension (NMAX*NMAX) */
00195 
00196 /*  AINV    (workspace) REAL array, dimension (NMAX*NMAX) */
00197 
00198 /*  B       (workspace) REAL array, dimension (NMAX*NSMAX) */
00199 /*          where NSMAX is the largest entry in NSVAL. */
00200 
00201 /*  X       (workspace) REAL array, dimension (NMAX*NSMAX) */
00202 
00203 /*  XACT    (workspace) REAL array, dimension (NMAX*NSMAX) */
00204 
00205 /*  WORK    (workspace) REAL array, dimension */
00206 /*                      (NMAX*max(3,NSMAX)) */
00207 
00208 /*  RWORK   (workspace) REAL array, dimension */
00209 /*                      (max(NMAX,2*NSMAX)) */
00210 
00211 /*  NOUT    (input) INTEGER */
00212 /*          The unit number for output. */
00213 
00214 /*  ===================================================================== */
00215 
00216 /*     .. Parameters .. */
00217 /*     .. */
00218 /*     .. Local Scalars .. */
00219 /*     .. */
00220 /*     .. Local Arrays .. */
00221 /*     .. */
00222 /*     .. External Functions .. */
00223 /*     .. */
00224 /*     .. External Subroutines .. */
00225 /*     .. */
00226 /*     .. Intrinsic Functions .. */
00227 /*     .. */
00228 /*     .. Scalars in Common .. */
00229 /*     .. */
00230 /*     .. Common blocks .. */
00231 /*     .. */
00232 /*     .. Data statements .. */
00233     /* Parameter adjustments */
00234     --rwork;
00235     --work;
00236     --xact;
00237     --x;
00238     --b;
00239     --ainv;
00240     --afac;
00241     --a;
00242     --nsval;
00243     --nbval;
00244     --nval;
00245     --dotype;
00246 
00247     /* Function Body */
00248 /*     .. */
00249 /*     .. Executable Statements .. */
00250 
00251 /*     Initialize constants and the random number seed. */
00252 
00253     s_copy(path, "Complex precision", (ftnlen)1, (ftnlen)17);
00254     s_copy(path + 1, "PB", (ftnlen)2, (ftnlen)2);
00255     nrun = 0;
00256     nfail = 0;
00257     nerrs = 0;
00258     for (i__ = 1; i__ <= 4; ++i__) {
00259         iseed[i__ - 1] = iseedy[i__ - 1];
00260 /* L10: */
00261     }
00262 
00263 /*     Test the error exits */
00264 
00265     if (*tsterr) {
00266         cerrpo_(path, nout);
00267     }
00268     infoc_1.infot = 0;
00269     kdval[0] = 0;
00270 
00271 /*     Do for each value of N in NVAL */
00272 
00273     i__1 = *nn;
00274     for (in = 1; in <= i__1; ++in) {
00275         n = nval[in];
00276         lda = max(n,1);
00277         *(unsigned char *)xtype = 'N';
00278 
00279 /*        Set limits on the number of loop iterations. */
00280 
00281 /* Computing MAX */
00282         i__2 = 1, i__3 = min(n,4);
00283         nkd = max(i__2,i__3);
00284         nimat = 8;
00285         if (n == 0) {
00286             nimat = 1;
00287         }
00288 
00289         kdval[1] = n + (n + 1) / 4;
00290         kdval[2] = (n * 3 - 1) / 4;
00291         kdval[3] = (n + 1) / 4;
00292 
00293         i__2 = nkd;
00294         for (ikd = 1; ikd <= i__2; ++ikd) {
00295 
00296 /*           Do for KD = 0, (5*N+1)/4, (3N-1)/4, and (N+1)/4. This order */
00297 /*           makes it easier to skip redundant values for small values */
00298 /*           of N. */
00299 
00300             kd = kdval[ikd - 1];
00301             ldab = kd + 1;
00302 
00303 /*           Do first for UPLO = 'U', then for UPLO = 'L' */
00304 
00305             for (iuplo = 1; iuplo <= 2; ++iuplo) {
00306                 koff = 1;
00307                 if (iuplo == 1) {
00308                     *(unsigned char *)uplo = 'U';
00309 /* Computing MAX */
00310                     i__3 = 1, i__4 = kd + 2 - n;
00311                     koff = max(i__3,i__4);
00312                     *(unsigned char *)packit = 'Q';
00313                 } else {
00314                     *(unsigned char *)uplo = 'L';
00315                     *(unsigned char *)packit = 'B';
00316                 }
00317 
00318                 i__3 = nimat;
00319                 for (imat = 1; imat <= i__3; ++imat) {
00320 
00321 /*                 Do the tests only if DOTYPE( IMAT ) is true. */
00322 
00323                     if (! dotype[imat]) {
00324                         goto L60;
00325                     }
00326 
00327 /*                 Skip types 2, 3, or 4 if the matrix size is too small. */
00328 
00329                     zerot = imat >= 2 && imat <= 4;
00330                     if (zerot && n < imat - 1) {
00331                         goto L60;
00332                     }
00333 
00334                     if (! zerot || ! dotype[1]) {
00335 
00336 /*                    Set up parameters with CLATB4 and generate a test */
00337 /*                    matrix with CLATMS. */
00338 
00339                         clatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, 
00340                                  &mode, &cndnum, dist);
00341 
00342                         s_copy(srnamc_1.srnamt, "CLATMS", (ftnlen)32, (ftnlen)
00343                                 6);
00344                         clatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, 
00345                                  &cndnum, &anorm, &kd, &kd, packit, &a[koff], 
00346                                 &ldab, &work[1], &info);
00347 
00348 /*                    Check error code from CLATMS. */
00349 
00350                         if (info != 0) {
00351                             alaerh_(path, "CLATMS", &info, &c__0, uplo, &n, &
00352                                     n, &kd, &kd, &c_n1, &imat, &nfail, &nerrs, 
00353                                      nout);
00354                             goto L60;
00355                         }
00356                     } else if (izero > 0) {
00357 
00358 /*                    Use the same matrix for types 3 and 4 as for type */
00359 /*                    2 by copying back the zeroed out column, */
00360 
00361                         iw = (lda << 1) + 1;
00362                         if (iuplo == 1) {
00363                             ioff = (izero - 1) * ldab + kd + 1;
00364                             i__4 = izero - i1;
00365                             ccopy_(&i__4, &work[iw], &c__1, &a[ioff - izero + 
00366                                     i1], &c__1);
00367                             iw = iw + izero - i1;
00368                             i__4 = i2 - izero + 1;
00369 /* Computing MAX */
00370                             i__6 = ldab - 1;
00371                             i__5 = max(i__6,1);
00372                             ccopy_(&i__4, &work[iw], &c__1, &a[ioff], &i__5);
00373                         } else {
00374                             ioff = (i1 - 1) * ldab + 1;
00375                             i__4 = izero - i1;
00376 /* Computing MAX */
00377                             i__6 = ldab - 1;
00378                             i__5 = max(i__6,1);
00379                             ccopy_(&i__4, &work[iw], &c__1, &a[ioff + izero - 
00380                                     i1], &i__5);
00381                             ioff = (izero - 1) * ldab + 1;
00382                             iw = iw + izero - i1;
00383                             i__4 = i2 - izero + 1;
00384                             ccopy_(&i__4, &work[iw], &c__1, &a[ioff], &c__1);
00385                         }
00386                     }
00387 
00388 /*                 For types 2-4, zero one row and column of the matrix */
00389 /*                 to test that INFO is returned correctly. */
00390 
00391                     izero = 0;
00392                     if (zerot) {
00393                         if (imat == 2) {
00394                             izero = 1;
00395                         } else if (imat == 3) {
00396                             izero = n;
00397                         } else {
00398                             izero = n / 2 + 1;
00399                         }
00400 
00401 /*                    Save the zeroed out row and column in WORK(*,3) */
00402 
00403                         iw = lda << 1;
00404 /* Computing MIN */
00405                         i__5 = (kd << 1) + 1;
00406                         i__4 = min(i__5,n);
00407                         for (i__ = 1; i__ <= i__4; ++i__) {
00408                             i__5 = iw + i__;
00409                             work[i__5].r = 0.f, work[i__5].i = 0.f;
00410 /* L20: */
00411                         }
00412                         ++iw;
00413 /* Computing MAX */
00414                         i__4 = izero - kd;
00415                         i1 = max(i__4,1);
00416 /* Computing MIN */
00417                         i__4 = izero + kd;
00418                         i2 = min(i__4,n);
00419 
00420                         if (iuplo == 1) {
00421                             ioff = (izero - 1) * ldab + kd + 1;
00422                             i__4 = izero - i1;
00423                             cswap_(&i__4, &a[ioff - izero + i1], &c__1, &work[
00424                                     iw], &c__1);
00425                             iw = iw + izero - i1;
00426                             i__4 = i2 - izero + 1;
00427 /* Computing MAX */
00428                             i__6 = ldab - 1;
00429                             i__5 = max(i__6,1);
00430                             cswap_(&i__4, &a[ioff], &i__5, &work[iw], &c__1);
00431                         } else {
00432                             ioff = (i1 - 1) * ldab + 1;
00433                             i__4 = izero - i1;
00434 /* Computing MAX */
00435                             i__6 = ldab - 1;
00436                             i__5 = max(i__6,1);
00437                             cswap_(&i__4, &a[ioff + izero - i1], &i__5, &work[
00438                                     iw], &c__1);
00439                             ioff = (izero - 1) * ldab + 1;
00440                             iw = iw + izero - i1;
00441                             i__4 = i2 - izero + 1;
00442                             cswap_(&i__4, &a[ioff], &c__1, &work[iw], &c__1);
00443                         }
00444                     }
00445 
00446 /*                 Set the imaginary part of the diagonals. */
00447 
00448                     if (iuplo == 1) {
00449                         claipd_(&n, &a[kd + 1], &ldab, &c__0);
00450                     } else {
00451                         claipd_(&n, &a[1], &ldab, &c__0);
00452                     }
00453 
00454 /*                 Do for each value of NB in NBVAL */
00455 
00456                     i__4 = *nnb;
00457                     for (inb = 1; inb <= i__4; ++inb) {
00458                         nb = nbval[inb];
00459                         xlaenv_(&c__1, &nb);
00460 
00461 /*                    Compute the L*L' or U'*U factorization of the band */
00462 /*                    matrix. */
00463 
00464                         i__5 = kd + 1;
00465                         clacpy_("Full", &i__5, &n, &a[1], &ldab, &afac[1], &
00466                                 ldab);
00467                         s_copy(srnamc_1.srnamt, "CPBTRF", (ftnlen)32, (ftnlen)
00468                                 6);
00469                         cpbtrf_(uplo, &n, &kd, &afac[1], &ldab, &info);
00470 
00471 /*                    Check error code from CPBTRF. */
00472 
00473                         if (info != izero) {
00474                             alaerh_(path, "CPBTRF", &info, &izero, uplo, &n, &
00475                                     n, &kd, &kd, &nb, &imat, &nfail, &nerrs, 
00476                                     nout);
00477                             goto L50;
00478                         }
00479 
00480 /*                    Skip the tests if INFO is not 0. */
00481 
00482                         if (info != 0) {
00483                             goto L50;
00484                         }
00485 
00486 /* +    TEST 1 */
00487 /*                    Reconstruct matrix from factors and compute */
00488 /*                    residual. */
00489 
00490                         i__5 = kd + 1;
00491                         clacpy_("Full", &i__5, &n, &afac[1], &ldab, &ainv[1], 
00492                                 &ldab);
00493                         cpbt01_(uplo, &n, &kd, &a[1], &ldab, &ainv[1], &ldab, 
00494                                 &rwork[1], result);
00495 
00496 /*                    Print the test ratio if it is .GE. THRESH. */
00497 
00498                         if (result[0] >= *thresh) {
00499                             if (nfail == 0 && nerrs == 0) {
00500                                 alahd_(nout, path);
00501                             }
00502                             io___40.ciunit = *nout;
00503                             s_wsfe(&io___40);
00504                             do_fio(&c__1, uplo, (ftnlen)1);
00505                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00506                                     ;
00507                             do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer)
00508                                     );
00509                             do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(integer)
00510                                     );
00511                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00512                                     integer));
00513                             do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(
00514                                     integer));
00515                             do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(
00516                                     real));
00517                             e_wsfe();
00518                             ++nfail;
00519                         }
00520                         ++nrun;
00521 
00522 /*                    Only do other tests if this is the first blocksize. */
00523 
00524                         if (inb > 1) {
00525                             goto L50;
00526                         }
00527 
00528 /*                    Form the inverse of A so we can get a good estimate */
00529 /*                    of RCONDC = 1/(norm(A) * norm(inv(A))). */
00530 
00531                         claset_("Full", &n, &n, &c_b50, &c_b51, &ainv[1], &
00532                                 lda);
00533                         s_copy(srnamc_1.srnamt, "CPBTRS", (ftnlen)32, (ftnlen)
00534                                 6);
00535                         cpbtrs_(uplo, &n, &kd, &n, &afac[1], &ldab, &ainv[1], 
00536                                 &lda, &info);
00537 
00538 /*                    Compute RCONDC = 1/(norm(A) * norm(inv(A))). */
00539 
00540                         anorm = clanhb_("1", uplo, &n, &kd, &a[1], &ldab, &
00541                                 rwork[1]);
00542                         ainvnm = clange_("1", &n, &n, &ainv[1], &lda, &rwork[
00543                                 1]);
00544                         if (anorm <= 0.f || ainvnm <= 0.f) {
00545                             rcondc = 1.f;
00546                         } else {
00547                             rcondc = 1.f / anorm / ainvnm;
00548                         }
00549 
00550                         i__5 = *nns;
00551                         for (irhs = 1; irhs <= i__5; ++irhs) {
00552                             nrhs = nsval[irhs];
00553 
00554 /* +    TEST 2 */
00555 /*                    Solve and compute residual for A * X = B. */
00556 
00557                             s_copy(srnamc_1.srnamt, "CLARHS", (ftnlen)32, (
00558                                     ftnlen)6);
00559                             clarhs_(path, xtype, uplo, " ", &n, &n, &kd, &kd, 
00560                                     &nrhs, &a[1], &ldab, &xact[1], &lda, &b[1]
00561 , &lda, iseed, &info);
00562                             clacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &
00563                                     lda);
00564 
00565                             s_copy(srnamc_1.srnamt, "CPBTRS", (ftnlen)32, (
00566                                     ftnlen)6);
00567                             cpbtrs_(uplo, &n, &kd, &nrhs, &afac[1], &ldab, &x[
00568                                     1], &lda, &info);
00569 
00570 /*                    Check error code from CPBTRS. */
00571 
00572                             if (info != 0) {
00573                                 alaerh_(path, "CPBTRS", &info, &c__0, uplo, &
00574                                         n, &n, &kd, &kd, &nrhs, &imat, &nfail, 
00575                                          &nerrs, nout);
00576                             }
00577 
00578                             clacpy_("Full", &n, &nrhs, &b[1], &lda, &work[1], 
00579                                     &lda);
00580                             cpbt02_(uplo, &n, &kd, &nrhs, &a[1], &ldab, &x[1], 
00581                                      &lda, &work[1], &lda, &rwork[1], &result[
00582                                     1]);
00583 
00584 /* +    TEST 3 */
00585 /*                    Check solution from generated exact solution. */
00586 
00587                             cget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00588                                     rcondc, &result[2]);
00589 
00590 /* +    TESTS 4, 5, and 6 */
00591 /*                    Use iterative refinement to improve the solution. */
00592 
00593                             s_copy(srnamc_1.srnamt, "CPBRFS", (ftnlen)32, (
00594                                     ftnlen)6);
00595                             cpbrfs_(uplo, &n, &kd, &nrhs, &a[1], &ldab, &afac[
00596                                     1], &ldab, &b[1], &lda, &x[1], &lda, &
00597                                     rwork[1], &rwork[nrhs + 1], &work[1], &
00598                                     rwork[(nrhs << 1) + 1], &info);
00599 
00600 /*                    Check error code from CPBRFS. */
00601 
00602                             if (info != 0) {
00603                                 alaerh_(path, "CPBRFS", &info, &c__0, uplo, &
00604                                         n, &n, &kd, &kd, &nrhs, &imat, &nfail, 
00605                                          &nerrs, nout);
00606                             }
00607 
00608                             cget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00609                                     rcondc, &result[3]);
00610                             cpbt05_(uplo, &n, &kd, &nrhs, &a[1], &ldab, &b[1], 
00611                                      &lda, &x[1], &lda, &xact[1], &lda, &
00612                                     rwork[1], &rwork[nrhs + 1], &result[4]);
00613 
00614 /*                       Print information about the tests that did not */
00615 /*                       pass the threshold. */
00616 
00617                             for (k = 2; k <= 6; ++k) {
00618                                 if (result[k - 1] >= *thresh) {
00619                                     if (nfail == 0 && nerrs == 0) {
00620                                         alahd_(nout, path);
00621                                     }
00622                                     io___46.ciunit = *nout;
00623                                     s_wsfe(&io___46);
00624                                     do_fio(&c__1, uplo, (ftnlen)1);
00625                                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00626                                             integer));
00627                                     do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(
00628                                             integer));
00629                                     do_fio(&c__1, (char *)&nrhs, (ftnlen)
00630                                             sizeof(integer));
00631                                     do_fio(&c__1, (char *)&imat, (ftnlen)
00632                                             sizeof(integer));
00633                                     do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00634                                             integer));
00635                                     do_fio(&c__1, (char *)&result[k - 1], (
00636                                             ftnlen)sizeof(real));
00637                                     e_wsfe();
00638                                     ++nfail;
00639                                 }
00640 /* L30: */
00641                             }
00642                             nrun += 5;
00643 /* L40: */
00644                         }
00645 
00646 /* +    TEST 7 */
00647 /*                    Get an estimate of RCOND = 1/CNDNUM. */
00648 
00649                         s_copy(srnamc_1.srnamt, "CPBCON", (ftnlen)32, (ftnlen)
00650                                 6);
00651                         cpbcon_(uplo, &n, &kd, &afac[1], &ldab, &anorm, &
00652                                 rcond, &work[1], &rwork[1], &info);
00653 
00654 /*                    Check error code from CPBCON. */
00655 
00656                         if (info != 0) {
00657                             alaerh_(path, "CPBCON", &info, &c__0, uplo, &n, &
00658                                     n, &kd, &kd, &c_n1, &imat, &nfail, &nerrs, 
00659                                      nout);
00660                         }
00661 
00662                         result[6] = sget06_(&rcond, &rcondc);
00663 
00664 /*                    Print the test ratio if it is .GE. THRESH. */
00665 
00666                         if (result[6] >= *thresh) {
00667                             if (nfail == 0 && nerrs == 0) {
00668                                 alahd_(nout, path);
00669                             }
00670                             io___48.ciunit = *nout;
00671                             s_wsfe(&io___48);
00672                             do_fio(&c__1, uplo, (ftnlen)1);
00673                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00674                                     ;
00675                             do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer)
00676                                     );
00677                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00678                                     integer));
00679                             do_fio(&c__1, (char *)&c__7, (ftnlen)sizeof(
00680                                     integer));
00681                             do_fio(&c__1, (char *)&result[6], (ftnlen)sizeof(
00682                                     real));
00683                             e_wsfe();
00684                             ++nfail;
00685                         }
00686                         ++nrun;
00687 L50:
00688                         ;
00689                     }
00690 L60:
00691                     ;
00692                 }
00693 /* L70: */
00694             }
00695 /* L80: */
00696         }
00697 /* L90: */
00698     }
00699 
00700 /*     Print a summary of the results. */
00701 
00702     alasum_(path, nout, &nfail, &nrun, &nerrs);
00703 
00704     return 0;
00705 
00706 /*     End of CCHKPB */
00707 
00708 } /* cchkpb_ */


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