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


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