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


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