cchktr.c
Go to the documentation of this file.
00001 /* cchktr.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__1 = 1;
00034 static integer c__0 = 0;
00035 static integer c_n1 = -1;
00036 static integer c__2 = 2;
00037 static integer c__3 = 3;
00038 static integer c__7 = 7;
00039 static integer c__4 = 4;
00040 static real c_b99 = 1.f;
00041 static integer c__8 = 8;
00042 static integer c__9 = 9;
00043 
00044 /* Subroutine */ int cchktr_(logical *dotype, integer *nn, integer *nval, 
00045         integer *nnb, integer *nbval, integer *nns, integer *nsval, real *
00046         thresh, logical *tsterr, integer *nmax, complex *a, complex *ainv, 
00047         complex *b, complex *x, complex *xact, complex *work, real *rwork, 
00048         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', 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     extern /* Subroutine */ int cget04_(integer *, integer *, complex *, 
00092             integer *, complex *, integer *, real *, real *);
00093     real scale;
00094     integer nfail, iseed[4];
00095     extern logical lsame_(char *, char *);
00096     real rcond, anorm;
00097     integer itran;
00098     extern /* Subroutine */ int ccopy_(integer *, complex *, integer *, 
00099             complex *, integer *), ctrt01_(char *, char *, integer *, complex 
00100             *, integer *, complex *, integer *, real *, real *, real *), ctrt02_(char *, char *, char *, integer *, 
00101             integer *, complex *, integer *, complex *, integer *, complex *, 
00102             integer *, complex *, real *, real *), 
00103             ctrt03_(char *, char *, char *, integer *, integer *, complex *, 
00104             integer *, real *, real *, real *, complex *, integer *, complex *
00105 , integer *, complex *, real *), ctrt05_(
00106             char *, char *, char *, integer *, integer *, complex *, integer *
00107 , complex *, integer *, complex *, integer *, complex *, integer *
00108 , real *, real *, real *), ctrt06_(real *, 
00109              real *, char *, char *, integer *, complex *, integer *, real *, 
00110             real *);
00111     char trans[1];
00112     integer iuplo, nerrs;
00113     real dummy;
00114     char xtype[1];
00115     extern /* Subroutine */ int alaerh_(char *, char *, integer *, integer *, 
00116             char *, integer *, integer *, integer *, integer *, integer *, 
00117             integer *, integer *, integer *, integer *);
00118     real rcondc;
00119     extern /* Subroutine */ int clacpy_(char *, integer *, integer *, complex 
00120             *, integer *, complex *, integer *), clarhs_(char *, char 
00121             *, char *, char *, integer *, integer *, integer *, integer *, 
00122             integer *, complex *, integer *, complex *, integer *, complex *, 
00123             integer *, integer *, integer *);
00124     real rcondi;
00125     extern doublereal clantr_(char *, char *, char *, integer *, integer *, 
00126             complex *, integer *, real *);
00127     real rcondo;
00128     extern /* Subroutine */ int alasum_(char *, integer *, integer *, integer 
00129             *, integer *);
00130     real ainvnm;
00131     extern /* Subroutine */ int clatrs_(char *, char *, char *, char *, 
00132             integer *, complex *, integer *, complex *, real *, real *, 
00133             integer *), clattr_(integer *, 
00134             char *, char *, char *, integer *, integer *, complex *, integer *
00135 , complex *, complex *, real *, integer *)
00136             , ctrcon_(char *, char *, char *, integer *, complex *, integer *, 
00137              real *, complex *, real *, integer *), 
00138             xlaenv_(integer *, integer *), cerrtr_(char *, integer *),
00139              ctrrfs_(char *, char *, char *, integer *, integer *, complex *, 
00140             integer *, complex *, integer *, complex *, integer *, real *, 
00141             real *, complex *, real *, integer *), 
00142             ctrtri_(char *, char *, integer *, complex *, integer *, integer *
00143 );
00144     real result[9];
00145     extern /* Subroutine */ int ctrtrs_(char *, char *, char *, integer *, 
00146             integer *, complex *, integer *, complex *, integer *, integer *);
00147 
00148     /* Fortran I/O blocks */
00149     static cilist io___27 = { 0, 0, 0, fmt_9999, 0 };
00150     static cilist io___36 = { 0, 0, 0, fmt_9998, 0 };
00151     static cilist io___38 = { 0, 0, 0, fmt_9997, 0 };
00152     static cilist io___40 = { 0, 0, 0, fmt_9996, 0 };
00153     static cilist io___41 = { 0, 0, 0, fmt_9996, 0 };
00154 
00155 
00156 
00157 /*  -- LAPACK test routine (version 3.1) -- */
00158 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00159 /*     November 2006 */
00160 
00161 /*     .. Scalar Arguments .. */
00162 /*     .. */
00163 /*     .. Array Arguments .. */
00164 /*     .. */
00165 
00166 /*  Purpose */
00167 /*  ======= */
00168 
00169 /*  CCHKTR tests CTRTRI, -TRS, -RFS, and -CON, and CLATRS */
00170 
00171 /*  Arguments */
00172 /*  ========= */
00173 
00174 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00175 /*          The matrix types to be used for testing.  Matrices of type j */
00176 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00177 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00178 
00179 /*  NN      (input) INTEGER */
00180 /*          The number of values of N contained in the vector NVAL. */
00181 
00182 /*  NVAL    (input) INTEGER array, dimension (NN) */
00183 /*          The values of the matrix column dimension N. */
00184 
00185 /*  NNB     (input) INTEGER */
00186 /*          The number of values of NB contained in the vector NBVAL. */
00187 
00188 /*  NBVAL   (input) INTEGER array, dimension (NNB) */
00189 /*          The values of the blocksize NB. */
00190 
00191 /*  NNS     (input) INTEGER */
00192 /*          The number of values of NRHS contained in the vector NSVAL. */
00193 
00194 /*  NSVAL   (input) INTEGER array, dimension (NNS) */
00195 /*          The values of the number of right hand sides NRHS. */
00196 
00197 /*  THRESH  (input) REAL */
00198 /*          The threshold value for the test ratios.  A result is */
00199 /*          included in the output file if RESULT >= THRESH.  To have */
00200 /*          every test ratio printed, use THRESH = 0. */
00201 
00202 /*  TSTERR  (input) LOGICAL */
00203 /*          Flag that indicates whether error exits are to be tested. */
00204 
00205 /*  NMAX    (input) INTEGER */
00206 /*          The leading dimension of the work arrays. */
00207 /*          NMAX >= the maximum value of N in NVAL. */
00208 
00209 /*  A       (workspace) COMPLEX array, dimension (NMAX*NMAX) */
00210 
00211 /*  AINV    (workspace) COMPLEX array, dimension (NMAX*NMAX) */
00212 
00213 /*  B       (workspace) COMPLEX array, dimension (NMAX*NSMAX) */
00214 /*          where NSMAX is the largest entry in NSVAL. */
00215 
00216 /*  X       (workspace) COMPLEX array, dimension (NMAX*NSMAX) */
00217 
00218 /*  XACT    (workspace) COMPLEX array, dimension (NMAX*NSMAX) */
00219 
00220 /*  WORK    (workspace) COMPLEX array, dimension */
00221 /*                      (NMAX*max(3,NSMAX)) */
00222 
00223 /*  RWORK   (workspace) REAL array, dimension */
00224 /*                      (max(NMAX,2*NSMAX)) */
00225 
00226 /*  NOUT    (input) INTEGER */
00227 /*          The unit number for output. */
00228 
00229 /*  ===================================================================== */
00230 
00231 /*     .. Parameters .. */
00232 /*     .. */
00233 /*     .. Local Scalars .. */
00234 /*     .. */
00235 /*     .. Local Arrays .. */
00236 /*     .. */
00237 /*     .. External Functions .. */
00238 /*     .. */
00239 /*     .. External Subroutines .. */
00240 /*     .. */
00241 /*     .. Scalars in Common .. */
00242 /*     .. */
00243 /*     .. Common blocks .. */
00244 /*     .. */
00245 /*     .. Intrinsic Functions .. */
00246 /*     .. */
00247 /*     .. Data statements .. */
00248     /* Parameter adjustments */
00249     --rwork;
00250     --work;
00251     --xact;
00252     --x;
00253     --b;
00254     --ainv;
00255     --a;
00256     --nsval;
00257     --nbval;
00258     --nval;
00259     --dotype;
00260 
00261     /* Function Body */
00262 /*     .. */
00263 /*     .. Executable Statements .. */
00264 
00265 /*     Initialize constants and the random number seed. */
00266 
00267     s_copy(path, "Complex precision", (ftnlen)1, (ftnlen)17);
00268     s_copy(path + 1, "TR", (ftnlen)2, (ftnlen)2);
00269     nrun = 0;
00270     nfail = 0;
00271     nerrs = 0;
00272     for (i__ = 1; i__ <= 4; ++i__) {
00273         iseed[i__ - 1] = iseedy[i__ - 1];
00274 /* L10: */
00275     }
00276 
00277 /*     Test the error exits */
00278 
00279     if (*tsterr) {
00280         cerrtr_(path, nout);
00281     }
00282     infoc_1.infot = 0;
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 CLATTR to generate a triangular test matrix. */
00308 
00309                 s_copy(srnamc_1.srnamt, "CLATTR", (ftnlen)32, (ftnlen)6);
00310                 clattr_(&imat, uplo, "No transpose", diag, iseed, &n, &a[1], &
00311                         lda, &x[1], &work[1], &rwork[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                     clacpy_(uplo, &n, &n, &a[1], &lda, &ainv[1], &lda);
00333                     s_copy(srnamc_1.srnamt, "CTRTRI", (ftnlen)32, (ftnlen)6);
00334                     ctrtri_(uplo, diag, &n, &ainv[1], &lda, &info);
00335 
00336 /*                 Check error code from CTRTRI. */
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, "CTRTRI", &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 = clantr_("I", uplo, diag, &n, &n, &a[1], &lda, &
00350                             rwork[1]);
00351                     ainvnm = clantr_("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                     ctrt01_(uplo, diag, &n, &a[1], &lda, &ainv[1], &lda, &
00364                             rcondo, &rwork[1], result);
00365 /*                 Print the test ratio if it is .GE. THRESH. */
00366 
00367                     if (result[0] >= *thresh) {
00368                         if (nfail == 0 && nerrs == 0) {
00369                             alahd_(nout, path);
00370                         }
00371                         io___27.ciunit = *nout;
00372                         s_wsfe(&io___27);
00373                         do_fio(&c__1, uplo, (ftnlen)1);
00374                         do_fio(&c__1, diag, (ftnlen)1);
00375                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00376                         do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(integer));
00377                         do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00378                         do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00379                         do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(real)
00380                                 );
00381                         e_wsfe();
00382                         ++nfail;
00383                     }
00384                     ++nrun;
00385 
00386 /*                 Skip remaining tests if not the first block size. */
00387 
00388                     if (inb != 1) {
00389                         goto L60;
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 2 */
00412 /*                       Solve and compute residual for op(A)*x = b. */
00413 
00414                             s_copy(srnamc_1.srnamt, "CLARHS", (ftnlen)32, (
00415                                     ftnlen)6);
00416                             clarhs_(path, xtype, uplo, trans, &n, &n, &c__0, &
00417                                     idiag, &nrhs, &a[1], &lda, &xact[1], &lda, 
00418                                      &b[1], &lda, iseed, &info);
00419                             *(unsigned char *)xtype = 'C';
00420                             clacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &
00421                                     lda);
00422 
00423                             s_copy(srnamc_1.srnamt, "CTRTRS", (ftnlen)32, (
00424                                     ftnlen)6);
00425                             ctrtrs_(uplo, trans, diag, &n, &nrhs, &a[1], &lda, 
00426                                      &x[1], &lda, &info);
00427 
00428 /*                       Check error code from CTRTRS. */
00429 
00430                             if (info != 0) {
00431 /* Writing concatenation */
00432                                 i__5[0] = 1, a__2[0] = uplo;
00433                                 i__5[1] = 1, a__2[1] = trans;
00434                                 i__5[2] = 1, a__2[2] = diag;
00435                                 s_cat(ch__2, a__2, i__5, &c__3, (ftnlen)3);
00436                                 alaerh_(path, "CTRTRS", &info, &c__0, ch__2, &
00437                                         n, &n, &c_n1, &c_n1, &nrhs, &imat, &
00438                                         nfail, &nerrs, nout);
00439                             }
00440 
00441 /*                       This line is needed on a Sun SPARCstation. */
00442 
00443                             if (n > 0) {
00444                                 dummy = a[1].r;
00445                             }
00446 
00447                             ctrt02_(uplo, trans, diag, &n, &nrhs, &a[1], &lda, 
00448                                      &x[1], &lda, &b[1], &lda, &work[1], &
00449                                     rwork[1], &result[1]);
00450 
00451 /* +    TEST 3 */
00452 /*                       Check solution from generated exact solution. */
00453 
00454                             cget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00455                                     rcondc, &result[2]);
00456 
00457 /* +    TESTS 4, 5, and 6 */
00458 /*                       Use iterative refinement to improve the solution */
00459 /*                       and compute error bounds. */
00460 
00461                             s_copy(srnamc_1.srnamt, "CTRRFS", (ftnlen)32, (
00462                                     ftnlen)6);
00463                             ctrrfs_(uplo, trans, diag, &n, &nrhs, &a[1], &lda, 
00464                                      &b[1], &lda, &x[1], &lda, &rwork[1], &
00465                                     rwork[nrhs + 1], &work[1], &rwork[(nrhs <<
00466                                      1) + 1], &info);
00467 
00468 /*                       Check error code from CTRRFS. */
00469 
00470                             if (info != 0) {
00471 /* Writing concatenation */
00472                                 i__5[0] = 1, a__2[0] = uplo;
00473                                 i__5[1] = 1, a__2[1] = trans;
00474                                 i__5[2] = 1, a__2[2] = diag;
00475                                 s_cat(ch__2, a__2, i__5, &c__3, (ftnlen)3);
00476                                 alaerh_(path, "CTRRFS", &info, &c__0, ch__2, &
00477                                         n, &n, &c_n1, &c_n1, &nrhs, &imat, &
00478                                         nfail, &nerrs, nout);
00479                             }
00480 
00481                             cget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00482                                     rcondc, &result[3]);
00483                             ctrt05_(uplo, trans, diag, &n, &nrhs, &a[1], &lda, 
00484                                      &b[1], &lda, &x[1], &lda, &xact[1], &lda, 
00485                                      &rwork[1], &rwork[nrhs + 1], &result[4]);
00486 
00487 /*                       Print information about the tests that did not */
00488 /*                       pass the threshold. */
00489 
00490                             for (k = 2; k <= 6; ++k) {
00491                                 if (result[k - 1] >= *thresh) {
00492                                     if (nfail == 0 && nerrs == 0) {
00493                                         alahd_(nout, path);
00494                                     }
00495                                     io___36.ciunit = *nout;
00496                                     s_wsfe(&io___36);
00497                                     do_fio(&c__1, uplo, (ftnlen)1);
00498                                     do_fio(&c__1, trans, (ftnlen)1);
00499                                     do_fio(&c__1, diag, (ftnlen)1);
00500                                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00501                                             integer));
00502                                     do_fio(&c__1, (char *)&nrhs, (ftnlen)
00503                                             sizeof(integer));
00504                                     do_fio(&c__1, (char *)&imat, (ftnlen)
00505                                             sizeof(integer));
00506                                     do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00507                                             integer));
00508                                     do_fio(&c__1, (char *)&result[k - 1], (
00509                                             ftnlen)sizeof(real));
00510                                     e_wsfe();
00511                                     ++nfail;
00512                                 }
00513 /* L20: */
00514                             }
00515                             nrun += 5;
00516 /* L30: */
00517                         }
00518 /* L40: */
00519                     }
00520 
00521 /* +    TEST 7 */
00522 /*                       Get an estimate of RCOND = 1/CNDNUM. */
00523 
00524                     for (itran = 1; itran <= 2; ++itran) {
00525                         if (itran == 1) {
00526                             *(unsigned char *)norm = 'O';
00527                             rcondc = rcondo;
00528                         } else {
00529                             *(unsigned char *)norm = 'I';
00530                             rcondc = rcondi;
00531                         }
00532                         s_copy(srnamc_1.srnamt, "CTRCON", (ftnlen)32, (ftnlen)
00533                                 6);
00534                         ctrcon_(norm, uplo, diag, &n, &a[1], &lda, &rcond, &
00535                                 work[1], &rwork[1], &info);
00536 
00537 /*                       Check error code from CTRCON. */
00538 
00539                         if (info != 0) {
00540 /* Writing concatenation */
00541                             i__5[0] = 1, a__2[0] = norm;
00542                             i__5[1] = 1, a__2[1] = uplo;
00543                             i__5[2] = 1, a__2[2] = diag;
00544                             s_cat(ch__2, a__2, i__5, &c__3, (ftnlen)3);
00545                             alaerh_(path, "CTRCON", &info, &c__0, ch__2, &n, &
00546                                     n, &c_n1, &c_n1, &c_n1, &imat, &nfail, &
00547                                     nerrs, nout);
00548                         }
00549 
00550                         ctrt06_(&rcond, &rcondc, uplo, diag, &n, &a[1], &lda, 
00551                                 &rwork[1], &result[6]);
00552 
00553 /*                    Print the test ratio if it is .GE. THRESH. */
00554 
00555                         if (result[6] >= *thresh) {
00556                             if (nfail == 0 && nerrs == 0) {
00557                                 alahd_(nout, path);
00558                             }
00559                             io___38.ciunit = *nout;
00560                             s_wsfe(&io___38);
00561                             do_fio(&c__1, norm, (ftnlen)1);
00562                             do_fio(&c__1, uplo, (ftnlen)1);
00563                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00564                                     ;
00565                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00566                                     integer));
00567                             do_fio(&c__1, (char *)&c__7, (ftnlen)sizeof(
00568                                     integer));
00569                             do_fio(&c__1, (char *)&result[6], (ftnlen)sizeof(
00570                                     real));
00571                             e_wsfe();
00572                             ++nfail;
00573                         }
00574                         ++nrun;
00575 /* L50: */
00576                     }
00577 L60:
00578                     ;
00579                 }
00580 /* L70: */
00581             }
00582 L80:
00583             ;
00584         }
00585 
00586 /*        Use pathological test matrices to test CLATRS. */
00587 
00588         for (imat = 11; imat <= 18; ++imat) {
00589 
00590 /*           Do the tests only if DOTYPE( IMAT ) is true. */
00591 
00592             if (! dotype[imat]) {
00593                 goto L110;
00594             }
00595 
00596             for (iuplo = 1; iuplo <= 2; ++iuplo) {
00597 
00598 /*              Do first for UPLO = 'U', then for UPLO = 'L' */
00599 
00600                 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00601                 for (itran = 1; itran <= 3; ++itran) {
00602 
00603 /*                 Do for op(A) = A, A**T, and A**H. */
00604 
00605                     *(unsigned char *)trans = *(unsigned char *)&transs[itran 
00606                             - 1];
00607 
00608 /*                 Call CLATTR to generate a triangular test matrix. */
00609 
00610                     s_copy(srnamc_1.srnamt, "CLATTR", (ftnlen)32, (ftnlen)6);
00611                     clattr_(&imat, uplo, trans, diag, iseed, &n, &a[1], &lda, 
00612                             &x[1], &work[1], &rwork[1], &info);
00613 
00614 /* +    TEST 8 */
00615 /*                 Solve the system op(A)*x = b. */
00616 
00617                     s_copy(srnamc_1.srnamt, "CLATRS", (ftnlen)32, (ftnlen)6);
00618                     ccopy_(&n, &x[1], &c__1, &b[1], &c__1);
00619                     clatrs_(uplo, trans, diag, "N", &n, &a[1], &lda, &b[1], &
00620                             scale, &rwork[1], &info);
00621 
00622 /*                 Check error code from CLATRS. */
00623 
00624                     if (info != 0) {
00625 /* Writing concatenation */
00626                         i__6[0] = 1, a__3[0] = uplo;
00627                         i__6[1] = 1, a__3[1] = trans;
00628                         i__6[2] = 1, a__3[2] = diag;
00629                         i__6[3] = 1, a__3[3] = "N";
00630                         s_cat(ch__3, a__3, i__6, &c__4, (ftnlen)4);
00631                         alaerh_(path, "CLATRS", &info, &c__0, ch__3, &n, &n, &
00632                                 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs, 
00633                                 nout);
00634                     }
00635 
00636                     ctrt03_(uplo, trans, diag, &n, &c__1, &a[1], &lda, &scale, 
00637                              &rwork[1], &c_b99, &b[1], &lda, &x[1], &lda, &
00638                             work[1], &result[7]);
00639 
00640 /* +    TEST 9 */
00641 /*                 Solve op(A)*X = b again with NORMIN = 'Y'. */
00642 
00643                     ccopy_(&n, &x[1], &c__1, &b[n + 1], &c__1);
00644                     clatrs_(uplo, trans, diag, "Y", &n, &a[1], &lda, &b[n + 1]
00645 , &scale, &rwork[1], &info);
00646 
00647 /*                 Check error code from CLATRS. */
00648 
00649                     if (info != 0) {
00650 /* Writing concatenation */
00651                         i__6[0] = 1, a__3[0] = uplo;
00652                         i__6[1] = 1, a__3[1] = trans;
00653                         i__6[2] = 1, a__3[2] = diag;
00654                         i__6[3] = 1, a__3[3] = "Y";
00655                         s_cat(ch__3, a__3, i__6, &c__4, (ftnlen)4);
00656                         alaerh_(path, "CLATRS", &info, &c__0, ch__3, &n, &n, &
00657                                 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs, 
00658                                 nout);
00659                     }
00660 
00661                     ctrt03_(uplo, trans, diag, &n, &c__1, &a[1], &lda, &scale, 
00662                              &rwork[1], &c_b99, &b[n + 1], &lda, &x[1], &lda, 
00663                             &work[1], &result[8]);
00664 
00665 /*                 Print information about the tests that did not pass */
00666 /*                 the threshold. */
00667 
00668                     if (result[7] >= *thresh) {
00669                         if (nfail == 0 && nerrs == 0) {
00670                             alahd_(nout, path);
00671                         }
00672                         io___40.ciunit = *nout;
00673                         s_wsfe(&io___40);
00674                         do_fio(&c__1, "CLATRS", (ftnlen)6);
00675                         do_fio(&c__1, uplo, (ftnlen)1);
00676                         do_fio(&c__1, trans, (ftnlen)1);
00677                         do_fio(&c__1, diag, (ftnlen)1);
00678                         do_fio(&c__1, "N", (ftnlen)1);
00679                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00680                         do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00681                         do_fio(&c__1, (char *)&c__8, (ftnlen)sizeof(integer));
00682                         do_fio(&c__1, (char *)&result[7], (ftnlen)sizeof(real)
00683                                 );
00684                         e_wsfe();
00685                         ++nfail;
00686                     }
00687                     if (result[8] >= *thresh) {
00688                         if (nfail == 0 && nerrs == 0) {
00689                             alahd_(nout, path);
00690                         }
00691                         io___41.ciunit = *nout;
00692                         s_wsfe(&io___41);
00693                         do_fio(&c__1, "CLATRS", (ftnlen)6);
00694                         do_fio(&c__1, uplo, (ftnlen)1);
00695                         do_fio(&c__1, trans, (ftnlen)1);
00696                         do_fio(&c__1, diag, (ftnlen)1);
00697                         do_fio(&c__1, "Y", (ftnlen)1);
00698                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00699                         do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00700                         do_fio(&c__1, (char *)&c__9, (ftnlen)sizeof(integer));
00701                         do_fio(&c__1, (char *)&result[8], (ftnlen)sizeof(real)
00702                                 );
00703                         e_wsfe();
00704                         ++nfail;
00705                     }
00706                     nrun += 2;
00707 /* L90: */
00708                 }
00709 /* L100: */
00710             }
00711 L110:
00712             ;
00713         }
00714 /* L120: */
00715     }
00716 
00717 /*     Print a summary of the results. */
00718 
00719     alasum_(path, nout, &nfail, &nrun, &nerrs);
00720 
00721     return 0;
00722 
00723 /*     End of CCHKTR */
00724 
00725 } /* cchktr_ */


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