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


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