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


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