dchktb.c
Go to the documentation of this file.
00001 /* dchktb.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 doublereal c_b14 = 0.;
00034 static doublereal c_b15 = 1.;
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 integer c__7 = 7;
00042 static integer c__8 = 8;
00043 
00044 /* Subroutine */ int dchktb_(logical *dotype, integer *nn, integer *nval, 
00045         integer *nns, integer *nsval, doublereal *thresh, logical *tsterr, 
00046         integer *nmax, doublereal *ab, doublereal *ainv, doublereal *b, 
00047         doublereal *x, doublereal *xact, doublereal *work, doublereal *rwork, 
00048         integer *iwork, integer *nout)
00049 {
00050     /* Initialized data */
00051 
00052     static integer iseedy[4] = { 1988,1989,1990,1991 };
00053     static char uplos[1*2] = "U" "L";
00054     static char transs[1*3] = "N" "T" "C";
00055 
00056     /* Format strings */
00057     static char fmt_9999[] = "(\002 UPLO='\002,a1,\002', TRANS='\002,a1,\002"
00058             "',                        DIAG='\002,a1,\002', N=\002,i5,\002, K"
00059             "D=\002,i5,\002, NRHS=\002,i5,\002, type \002,i2,\002, test(\002,"
00060             "i2,\002)=\002,g12.5)";
00061     static char fmt_9998[] = "(1x,a,\002( '\002,a1,\002', '\002,a1,\002', "
00062             "'\002,a1,\002',\002,i5,\002,\002,i5,\002,  ... ), type \002,i2"
00063             ",\002, test(\002,i2,\002)=\002,g12.5)";
00064     static char fmt_9997[] = "(1x,a,\002( '\002,a1,\002', '\002,a1,\002', "
00065             "'\002,a1,\002', '\002,a1,\002',\002,i5,\002,\002,i5,\002, ...  )"
00066             ",  type \002,i2,\002, test(\002,i1,\002)=\002,g12.5)";
00067 
00068     /* System generated locals */
00069     address a__1[3], a__2[4];
00070     integer i__1, i__2, i__3, i__4, i__5, i__6[3], i__7[4];
00071     char ch__1[3], ch__2[4];
00072 
00073     /* Builtin functions */
00074     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen), s_cat(char *,
00075              char **, integer *, integer *, ftnlen);
00076     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00077 
00078     /* Local variables */
00079     integer i__, j, k, n, kd, ik, in, nk, lda, ldab;
00080     char diag[1];
00081     integer imat, info;
00082     char path[3];
00083     integer irhs, nrhs;
00084     char norm[1], uplo[1];
00085     integer nrun;
00086     extern /* Subroutine */ int alahd_(integer *, char *);
00087     integer idiag;
00088     doublereal scale;
00089     extern /* Subroutine */ int dget04_(integer *, integer *, doublereal *, 
00090             integer *, doublereal *, integer *, doublereal *, doublereal *);
00091     integer nfail, iseed[4];
00092     extern /* Subroutine */ int dtbt02_(char *, char *, char *, integer *, 
00093             integer *, integer *, doublereal *, integer *, doublereal *, 
00094             integer *, doublereal *, integer *, doublereal *, doublereal *), dtbt03_(char *, char *, char *, integer *
00095 , integer *, integer *, doublereal *, integer *, doublereal *, 
00096             doublereal *, doublereal *, doublereal *, integer *, doublereal *, 
00097              integer *, doublereal *, doublereal *);
00098     extern logical lsame_(char *, char *);
00099     extern /* Subroutine */ int dtbt05_(char *, char *, char *, integer *, 
00100             integer *, integer *, doublereal *, integer *, doublereal *, 
00101             integer *, doublereal *, integer *, doublereal *, integer *, 
00102             doublereal *, doublereal *, doublereal *),
00103              dtbt06_(doublereal *, doublereal *, char *, char *, integer *, 
00104             integer *, doublereal *, integer *, doublereal *, doublereal *);
00105     doublereal rcond;
00106     integer nimat;
00107     doublereal anorm;
00108     integer itran;
00109     extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *, 
00110             doublereal *, integer *), dtbsv_(char *, char *, char *, integer *
00111 , integer *, doublereal *, integer *, doublereal *, integer *);
00112     char trans[1];
00113     integer iuplo, nerrs;
00114     char xtype[1];
00115     integer nimat2;
00116     extern /* Subroutine */ int alaerh_(char *, char *, integer *, integer *, 
00117             char *, integer *, integer *, integer *, integer *, integer *, 
00118             integer *, integer *, integer *, integer *);
00119     extern doublereal dlantb_(char *, char *, char *, integer *, integer *, 
00120             doublereal *, integer *, doublereal *);
00121     doublereal rcondc;
00122     extern /* Subroutine */ int dlatbs_(char *, char *, char *, char *, 
00123             integer *, integer *, doublereal *, integer *, doublereal *, 
00124             doublereal *, doublereal *, integer *), dlattb_(integer *, char *, char *, char *, integer *, 
00125             integer *, integer *, doublereal *, integer *, doublereal *, 
00126             doublereal *, integer *), dtbcon_(char *, 
00127             char *, char *, integer *, integer *, doublereal *, integer *, 
00128             doublereal *, doublereal *, integer *, integer *), dlacpy_(char *, integer *, integer *, doublereal *, 
00129             integer *, doublereal *, integer *), dlarhs_(char *, char 
00130             *, char *, char *, integer *, integer *, integer *, integer *, 
00131             integer *, doublereal *, integer *, doublereal *, integer *, 
00132             doublereal *, integer *, integer *, integer *);
00133     doublereal rcondi;
00134     extern /* Subroutine */ int dlaset_(char *, integer *, integer *, 
00135             doublereal *, doublereal *, doublereal *, integer *), 
00136             alasum_(char *, integer *, integer *, integer *, integer *);
00137     doublereal rcondo;
00138     extern doublereal dlantr_(char *, char *, char *, integer *, integer *, 
00139             doublereal *, integer *, doublereal *);
00140     extern /* Subroutine */ int dtbrfs_(char *, char *, char *, integer *, 
00141             integer *, integer *, doublereal *, integer *, doublereal *, 
00142             integer *, doublereal *, integer *, doublereal *, doublereal *, 
00143             doublereal *, integer *, integer *);
00144     doublereal ainvnm;
00145     extern /* Subroutine */ int derrtr_(char *, integer *), dtbtrs_(
00146             char *, char *, char *, integer *, integer *, integer *, 
00147             doublereal *, integer *, doublereal *, integer *, integer *);
00148     doublereal result[8];
00149 
00150     /* Fortran I/O blocks */
00151     static cilist io___39 = { 0, 0, 0, fmt_9999, 0 };
00152     static cilist io___41 = { 0, 0, 0, fmt_9998, 0 };
00153     static cilist io___43 = { 0, 0, 0, fmt_9997, 0 };
00154     static cilist io___44 = { 0, 0, 0, fmt_9997, 0 };
00155 
00156 
00157 
00158 /*  -- LAPACK test routine (version 3.1) -- */
00159 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00160 /*     November 2006 */
00161 
00162 /*     .. Scalar Arguments .. */
00163 /*     .. */
00164 /*     .. Array Arguments .. */
00165 /*     .. */
00166 
00167 /*  Purpose */
00168 /*  ======= */
00169 
00170 /*  DCHKTB tests DTBTRS, -RFS, and -CON, and DLATBS. */
00171 
00172 /*  Arguments */
00173 /*  ========= */
00174 
00175 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00176 /*          The matrix types to be used for testing.  Matrices of type j */
00177 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00178 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00179 
00180 /*  NN      (input) INTEGER */
00181 /*          The number of values of N contained in the vector NVAL. */
00182 
00183 /*  NVAL    (input) INTEGER array, dimension (NN) */
00184 /*          The values of the matrix column dimension N. */
00185 
00186 /*  NNS     (input) INTEGER */
00187 /*          The number of values of NRHS contained in the vector NSVAL. */
00188 
00189 /*  NSVAL   (input) INTEGER array, dimension (NNS) */
00190 /*          The values of the number of right hand sides NRHS. */
00191 
00192 /*  THRESH  (input) DOUBLE PRECISION */
00193 /*          The threshold value for the test ratios.  A result is */
00194 /*          included in the output file if RESULT >= THRESH.  To have */
00195 /*          every test ratio printed, use THRESH = 0. */
00196 
00197 /*  TSTERR  (input) LOGICAL */
00198 /*          Flag that indicates whether error exits are to be tested. */
00199 
00200 /*  NMAX    (input) INTEGER */
00201 /*          The leading dimension of the work arrays. */
00202 /*          NMAX >= the maximum value of N in NVAL. */
00203 
00204 /*  AB      (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00205 
00206 /*  AINV    (workspace) DOUBLE PRECISION array, dimension (NMAX*NMAX) */
00207 
00208 /*  B       (workspace) DOUBLE PRECISION array, dimension (NMAX*NSMAX) */
00209 /*          where NSMAX is the largest entry in NSVAL. */
00210 
00211 /*  X       (workspace) DOUBLE PRECISION array, dimension (NMAX*NSMAX) */
00212 
00213 /*  XACT    (workspace) DOUBLE PRECISION array, dimension (NMAX*NSMAX) */
00214 
00215 /*  WORK    (workspace) DOUBLE PRECISION array, dimension */
00216 /*                      (NMAX*max(3,NSMAX)) */
00217 
00218 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension */
00219 /*                      (max(NMAX,2*NSMAX)) */
00220 
00221 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00222 
00223 /*  NOUT    (input) INTEGER */
00224 /*          The unit number for output. */
00225 
00226 /*  ===================================================================== */
00227 
00228 /*     .. Parameters .. */
00229 /*     .. */
00230 /*     .. Local Scalars .. */
00231 /*     .. */
00232 /*     .. Local Arrays .. */
00233 /*     .. */
00234 /*     .. External Functions .. */
00235 /*     .. */
00236 /*     .. External Subroutines .. */
00237 /*     .. */
00238 /*     .. Scalars in Common .. */
00239 /*     .. */
00240 /*     .. Common blocks .. */
00241 /*     .. */
00242 /*     .. Intrinsic Functions .. */
00243 /*     .. */
00244 /*     .. Data statements .. */
00245     /* Parameter adjustments */
00246     --iwork;
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, "Double precision", (ftnlen)1, (ftnlen)16);
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         derrtr_(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 DLATTB to generate a triangular test matrix. */
00333 
00334                     s_copy(srnamc_1.srnamt, "DLATTB", (ftnlen)32, (ftnlen)6);
00335                     dlattb_(&imat, uplo, "No transpose", diag, iseed, &n, &kd, 
00336                              &ab[1], &ldab, &x[1], &work[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                     dlaset_("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                             dtbsv_(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                             dtbsv_(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 = dlantb_("1", uplo, diag, &n, &kd, &ab[1], &ldab, &
00371                             rwork[1]);
00372                     ainvnm = dlantr_("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 = dlantb_("I", uplo, diag, &n, &kd, &ab[1], &ldab, &
00383                             rwork[1]);
00384                     ainvnm = dlantr_("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, "DLARHS", (ftnlen)32, (
00415                                     ftnlen)6);
00416                             dlarhs_(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                             dlacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &
00421                                     lda);
00422 
00423                             s_copy(srnamc_1.srnamt, "DTBTRS", (ftnlen)32, (
00424                                     ftnlen)6);
00425                             dtbtrs_(uplo, trans, diag, &n, &kd, &nrhs, &ab[1], 
00426                                      &ldab, &x[1], &lda, &info);
00427 
00428 /*                    Check error code from DTBTRS. */
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, "DTBTRS", &info, &c__0, ch__1, &
00437                                         n, &n, &kd, &kd, &nrhs, &imat, &nfail, 
00438                                          &nerrs, nout);
00439                             }
00440 
00441                             dtbt02_(uplo, trans, diag, &n, &kd, &nrhs, &ab[1], 
00442                                      &ldab, &x[1], &lda, &b[1], &lda, &work[1]
00443 , result)
00444                                     ;
00445 
00446 /* +    TEST 2 */
00447 /*                    Check solution from generated exact solution. */
00448 
00449                             dget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00450                                     rcondc, &result[1]);
00451 
00452 /* +    TESTS 3, 4, and 5 */
00453 /*                    Use iterative refinement to improve the solution */
00454 /*                    and compute error bounds. */
00455 
00456                             s_copy(srnamc_1.srnamt, "DTBRFS", (ftnlen)32, (
00457                                     ftnlen)6);
00458                             dtbrfs_(uplo, trans, diag, &n, &kd, &nrhs, &ab[1], 
00459                                      &ldab, &b[1], &lda, &x[1], &lda, &rwork[
00460                                     1], &rwork[nrhs + 1], &work[1], &iwork[1], 
00461                                      &info);
00462 
00463 /*                    Check error code from DTBRFS. */
00464 
00465                             if (info != 0) {
00466 /* Writing concatenation */
00467                                 i__6[0] = 1, a__1[0] = uplo;
00468                                 i__6[1] = 1, a__1[1] = trans;
00469                                 i__6[2] = 1, a__1[2] = diag;
00470                                 s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)3);
00471                                 alaerh_(path, "DTBRFS", &info, &c__0, ch__1, &
00472                                         n, &n, &kd, &kd, &nrhs, &imat, &nfail, 
00473                                          &nerrs, nout);
00474                             }
00475 
00476                             dget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00477                                     rcondc, &result[2]);
00478                             dtbt05_(uplo, trans, diag, &n, &kd, &nrhs, &ab[1], 
00479                                      &ldab, &b[1], &lda, &x[1], &lda, &xact[1]
00480 , &lda, &rwork[1], &rwork[nrhs + 1], &
00481                                     result[3]);
00482 
00483 /*                       Print information about the tests that did not */
00484 /*                       pass the threshold. */
00485 
00486                             for (k = 1; k <= 5; ++k) {
00487                                 if (result[k - 1] >= *thresh) {
00488                                     if (nfail == 0 && nerrs == 0) {
00489                                         alahd_(nout, path);
00490                                     }
00491                                     io___39.ciunit = *nout;
00492                                     s_wsfe(&io___39);
00493                                     do_fio(&c__1, uplo, (ftnlen)1);
00494                                     do_fio(&c__1, trans, (ftnlen)1);
00495                                     do_fio(&c__1, diag, (ftnlen)1);
00496                                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00497                                             integer));
00498                                     do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(
00499                                             integer));
00500                                     do_fio(&c__1, (char *)&nrhs, (ftnlen)
00501                                             sizeof(integer));
00502                                     do_fio(&c__1, (char *)&imat, (ftnlen)
00503                                             sizeof(integer));
00504                                     do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00505                                             integer));
00506                                     do_fio(&c__1, (char *)&result[k - 1], (
00507                                             ftnlen)sizeof(doublereal));
00508                                     e_wsfe();
00509                                     ++nfail;
00510                                 }
00511 /* L40: */
00512                             }
00513                             nrun += 5;
00514 /* L50: */
00515                         }
00516 /* L60: */
00517                     }
00518 
00519 /* +    TEST 6 */
00520 /*                    Get an estimate of RCOND = 1/CNDNUM. */
00521 
00522                     for (itran = 1; itran <= 2; ++itran) {
00523                         if (itran == 1) {
00524                             *(unsigned char *)norm = 'O';
00525                             rcondc = rcondo;
00526                         } else {
00527                             *(unsigned char *)norm = 'I';
00528                             rcondc = rcondi;
00529                         }
00530                         s_copy(srnamc_1.srnamt, "DTBCON", (ftnlen)32, (ftnlen)
00531                                 6);
00532                         dtbcon_(norm, uplo, diag, &n, &kd, &ab[1], &ldab, &
00533                                 rcond, &work[1], &iwork[1], &info);
00534 
00535 /*                    Check error code from DTBCON. */
00536 
00537                         if (info != 0) {
00538 /* Writing concatenation */
00539                             i__6[0] = 1, a__1[0] = norm;
00540                             i__6[1] = 1, a__1[1] = uplo;
00541                             i__6[2] = 1, a__1[2] = diag;
00542                             s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)3);
00543                             alaerh_(path, "DTBCON", &info, &c__0, ch__1, &n, &
00544                                     n, &kd, &kd, &c_n1, &imat, &nfail, &nerrs, 
00545                                      nout);
00546                         }
00547 
00548                         dtbt06_(&rcond, &rcondc, uplo, diag, &n, &kd, &ab[1], 
00549                                 &ldab, &rwork[1], &result[5]);
00550 
00551 /*                    Print information about the tests that did not pass */
00552 /*                    the threshold. */
00553 
00554                         if (result[5] >= *thresh) {
00555                             if (nfail == 0 && nerrs == 0) {
00556                                 alahd_(nout, path);
00557                             }
00558                             io___41.ciunit = *nout;
00559                             s_wsfe(&io___41);
00560                             do_fio(&c__1, "DTBCON", (ftnlen)6);
00561                             do_fio(&c__1, norm, (ftnlen)1);
00562                             do_fio(&c__1, uplo, (ftnlen)1);
00563                             do_fio(&c__1, diag, (ftnlen)1);
00564                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00565                                     ;
00566                             do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer)
00567                                     );
00568                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00569                                     integer));
00570                             do_fio(&c__1, (char *)&c__6, (ftnlen)sizeof(
00571                                     integer));
00572                             do_fio(&c__1, (char *)&result[5], (ftnlen)sizeof(
00573                                     doublereal));
00574                             e_wsfe();
00575                             ++nfail;
00576                         }
00577                         ++nrun;
00578 /* L70: */
00579                     }
00580 /* L80: */
00581                 }
00582 L90:
00583                 ;
00584             }
00585 
00586 /*           Use pathological test matrices to test DLATBS. */
00587 
00588             i__3 = nimat2;
00589             for (imat = 10; imat <= i__3; ++imat) {
00590 
00591 /*              Do the tests only if DOTYPE( IMAT ) is true. */
00592 
00593                 if (! dotype[imat]) {
00594                     goto L120;
00595                 }
00596 
00597                 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00598 
00599 /*                 Do first for UPLO = 'U', then for UPLO = 'L' */
00600 
00601                     *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 
00602                             1];
00603                     for (itran = 1; itran <= 3; ++itran) {
00604 
00605 /*                    Do for op(A) = A, A**T, and A**H. */
00606 
00607                         *(unsigned char *)trans = *(unsigned char *)&transs[
00608                                 itran - 1];
00609 
00610 /*                    Call DLATTB to generate a triangular test matrix. */
00611 
00612                         s_copy(srnamc_1.srnamt, "DLATTB", (ftnlen)32, (ftnlen)
00613                                 6);
00614                         dlattb_(&imat, uplo, trans, diag, iseed, &n, &kd, &ab[
00615                                 1], &ldab, &x[1], &work[1], &info);
00616 
00617 /* +    TEST 7 */
00618 /*                    Solve the system op(A)*x = b */
00619 
00620                         s_copy(srnamc_1.srnamt, "DLATBS", (ftnlen)32, (ftnlen)
00621                                 6);
00622                         dcopy_(&n, &x[1], &c__1, &b[1], &c__1);
00623                         dlatbs_(uplo, trans, diag, "N", &n, &kd, &ab[1], &
00624                                 ldab, &b[1], &scale, &rwork[1], &info);
00625 
00626 /*                    Check error code from DLATBS. */
00627 
00628                         if (info != 0) {
00629 /* Writing concatenation */
00630                             i__7[0] = 1, a__2[0] = uplo;
00631                             i__7[1] = 1, a__2[1] = trans;
00632                             i__7[2] = 1, a__2[2] = diag;
00633                             i__7[3] = 1, a__2[3] = "N";
00634                             s_cat(ch__2, a__2, i__7, &c__4, (ftnlen)4);
00635                             alaerh_(path, "DLATBS", &info, &c__0, ch__2, &n, &
00636                                     n, &kd, &kd, &c_n1, &imat, &nfail, &nerrs, 
00637                                      nout);
00638                         }
00639 
00640                         dtbt03_(uplo, trans, diag, &n, &kd, &c__1, &ab[1], &
00641                                 ldab, &scale, &rwork[1], &c_b15, &b[1], &lda, 
00642                                 &x[1], &lda, &work[1], &result[6]);
00643 
00644 /* +    TEST 8 */
00645 /*                    Solve op(A)*x = b again with NORMIN = 'Y'. */
00646 
00647                         dcopy_(&n, &x[1], &c__1, &b[1], &c__1);
00648                         dlatbs_(uplo, trans, diag, "Y", &n, &kd, &ab[1], &
00649                                 ldab, &b[1], &scale, &rwork[1], &info);
00650 
00651 /*                    Check error code from DLATBS. */
00652 
00653                         if (info != 0) {
00654 /* Writing concatenation */
00655                             i__7[0] = 1, a__2[0] = uplo;
00656                             i__7[1] = 1, a__2[1] = trans;
00657                             i__7[2] = 1, a__2[2] = diag;
00658                             i__7[3] = 1, a__2[3] = "Y";
00659                             s_cat(ch__2, a__2, i__7, &c__4, (ftnlen)4);
00660                             alaerh_(path, "DLATBS", &info, &c__0, ch__2, &n, &
00661                                     n, &kd, &kd, &c_n1, &imat, &nfail, &nerrs, 
00662                                      nout);
00663                         }
00664 
00665                         dtbt03_(uplo, trans, diag, &n, &kd, &c__1, &ab[1], &
00666                                 ldab, &scale, &rwork[1], &c_b15, &b[1], &lda, 
00667                                 &x[1], &lda, &work[1], &result[7]);
00668 
00669 /*                    Print information about the tests that did not pass */
00670 /*                    the threshold. */
00671 
00672                         if (result[6] >= *thresh) {
00673                             if (nfail == 0 && nerrs == 0) {
00674                                 alahd_(nout, path);
00675                             }
00676                             io___43.ciunit = *nout;
00677                             s_wsfe(&io___43);
00678                             do_fio(&c__1, "DLATBS", (ftnlen)6);
00679                             do_fio(&c__1, uplo, (ftnlen)1);
00680                             do_fio(&c__1, trans, (ftnlen)1);
00681                             do_fio(&c__1, diag, (ftnlen)1);
00682                             do_fio(&c__1, "N", (ftnlen)1);
00683                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00684                                     ;
00685                             do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer)
00686                                     );
00687                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00688                                     integer));
00689                             do_fio(&c__1, (char *)&c__7, (ftnlen)sizeof(
00690                                     integer));
00691                             do_fio(&c__1, (char *)&result[6], (ftnlen)sizeof(
00692                                     doublereal));
00693                             e_wsfe();
00694                             ++nfail;
00695                         }
00696                         if (result[7] >= *thresh) {
00697                             if (nfail == 0 && nerrs == 0) {
00698                                 alahd_(nout, path);
00699                             }
00700                             io___44.ciunit = *nout;
00701                             s_wsfe(&io___44);
00702                             do_fio(&c__1, "DLATBS", (ftnlen)6);
00703                             do_fio(&c__1, uplo, (ftnlen)1);
00704                             do_fio(&c__1, trans, (ftnlen)1);
00705                             do_fio(&c__1, diag, (ftnlen)1);
00706                             do_fio(&c__1, "Y", (ftnlen)1);
00707                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00708                                     ;
00709                             do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer)
00710                                     );
00711                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00712                                     integer));
00713                             do_fio(&c__1, (char *)&c__8, (ftnlen)sizeof(
00714                                     integer));
00715                             do_fio(&c__1, (char *)&result[7], (ftnlen)sizeof(
00716                                     doublereal));
00717                             e_wsfe();
00718                             ++nfail;
00719                         }
00720                         nrun += 2;
00721 /* L100: */
00722                     }
00723 /* L110: */
00724                 }
00725 L120:
00726                 ;
00727             }
00728 /* L130: */
00729         }
00730 /* L140: */
00731     }
00732 
00733 /*     Print a summary of the results. */
00734 
00735     alasum_(path, nout, &nfail, &nrun, &nerrs);
00736 
00737     return 0;
00738 
00739 /*     End of DCHKTB */
00740 
00741 } /* dchktb_ */


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