zchkgt.c
Go to the documentation of this file.
00001 /* zchkgt.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, nunit;
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__3 = 3;
00034 static integer c__0 = 0;
00035 static integer c_n1 = -1;
00036 static integer c__1 = 1;
00037 static integer c__2 = 2;
00038 static integer c__7 = 7;
00039 static doublereal c_b63 = 1.;
00040 static doublereal c_b64 = 0.;
00041 
00042 /* Subroutine */ int zchkgt_(logical *dotype, integer *nn, integer *nval, 
00043         integer *nns, integer *nsval, doublereal *thresh, logical *tsterr, 
00044         doublecomplex *a, doublecomplex *af, doublecomplex *b, doublecomplex *
00045         x, doublecomplex *xact, doublecomplex *work, doublereal *rwork, 
00046         integer *iwork, integer *nout)
00047 {
00048     /* Initialized data */
00049 
00050     static integer iseedy[4] = { 0,0,0,1 };
00051     static char transs[1*3] = "N" "T" "C";
00052 
00053     /* Format strings */
00054     static char fmt_9999[] = "(12x,\002N =\002,i5,\002,\002,10x,\002 type"
00055             " \002,i2,\002, test(\002,i2,\002) = \002,g12.5)";
00056     static char fmt_9997[] = "(\002 NORM ='\002,a1,\002', N =\002,i5,\002"
00057             ",\002,10x,\002 type \002,i2,\002, test(\002,i2,\002) = \002,g12."
00058             "5)";
00059     static char fmt_9998[] = "(\002 TRANS='\002,a1,\002', N =\002,i5,\002, N"
00060             "RHS=\002,i3,\002, type \002,i2,\002, test(\002,i2,\002) = \002,g"
00061             "12.5)";
00062 
00063     /* System generated locals */
00064     integer i__1, i__2, i__3, i__4, i__5;
00065     doublereal d__1, d__2;
00066 
00067     /* Builtin functions */
00068     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00069     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00070 
00071     /* Local variables */
00072     integer i__, j, k, m, n;
00073     doublecomplex z__[3];
00074     integer in, kl, ku, ix, lda;
00075     doublereal cond;
00076     integer mode, koff, imat, info;
00077     char path[3], dist[1];
00078     integer irhs, nrhs;
00079     char norm[1], type__[1];
00080     integer nrun;
00081     extern /* Subroutine */ int alahd_(integer *, char *);
00082     integer nfail, iseed[4];
00083     extern doublereal dget06_(doublereal *, doublereal *);
00084     doublereal rcond;
00085     integer nimat;
00086     doublereal anorm;
00087     integer itran;
00088     extern /* Subroutine */ int zget04_(integer *, integer *, doublecomplex *, 
00089              integer *, doublecomplex *, integer *, doublereal *, doublereal *
00090 );
00091     char trans[1];
00092     integer izero, nerrs;
00093     extern /* Subroutine */ int zgtt01_(integer *, doublecomplex *, 
00094             doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *
00095 , doublecomplex *, doublecomplex *, integer *, doublecomplex *, 
00096             integer *, doublereal *, doublereal *), zgtt02_(char *, integer *, 
00097              integer *, doublecomplex *, doublecomplex *, doublecomplex *, 
00098             doublecomplex *, integer *, doublecomplex *, integer *, 
00099             doublereal *, doublereal *), zgtt05_(char *, integer *, 
00100             integer *, doublecomplex *, doublecomplex *, doublecomplex *, 
00101             doublecomplex *, integer *, doublecomplex *, integer *, 
00102             doublecomplex *, integer *, doublereal *, doublereal *, 
00103             doublereal *);
00104     logical zerot;
00105     extern /* Subroutine */ int zcopy_(integer *, doublecomplex *, integer *, 
00106             doublecomplex *, integer *), zlatb4_(char *, integer *, integer *, 
00107              integer *, char *, integer *, integer *, doublereal *, integer *, 
00108              doublereal *, char *), alaerh_(char *, 
00109             char *, integer *, integer *, char *, integer *, integer *, 
00110             integer *, integer *, integer *, integer *, integer *, integer *, 
00111             integer *);
00112     doublereal rcondc, rcondi;
00113     extern /* Subroutine */ int zdscal_(integer *, doublereal *, 
00114             doublecomplex *, integer *), alasum_(char *, integer *, integer *, 
00115              integer *, integer *);
00116     doublereal rcondo, ainvnm;
00117     logical trfcon;
00118     extern /* Subroutine */ int zerrge_(char *, integer *);
00119     extern doublereal zlangt_(char *, integer *, doublecomplex *, 
00120             doublecomplex *, doublecomplex *);
00121     extern /* Subroutine */ int zlagtm_(char *, integer *, integer *, 
00122             doublereal *, doublecomplex *, doublecomplex *, doublecomplex *, 
00123             doublecomplex *, integer *, doublereal *, doublecomplex *, 
00124             integer *), zlacpy_(char *, integer *, integer *, 
00125             doublecomplex *, integer *, doublecomplex *, integer *);
00126     extern doublereal dzasum_(integer *, doublecomplex *, integer *);
00127     extern /* Subroutine */ int zgtcon_(char *, integer *, doublecomplex *, 
00128             doublecomplex *, doublecomplex *, doublecomplex *, integer *, 
00129             doublereal *, doublereal *, doublecomplex *, integer *), 
00130             zlatms_(integer *, integer *, char *, integer *, char *, 
00131             doublereal *, integer *, doublereal *, doublereal *, integer *, 
00132             integer *, char *, doublecomplex *, integer *, doublecomplex *, 
00133             integer *), zlarnv_(integer *, integer *, 
00134             integer *, doublecomplex *);
00135     doublereal result[7];
00136     extern /* Subroutine */ int zgtrfs_(char *, integer *, integer *, 
00137             doublecomplex *, doublecomplex *, doublecomplex *, doublecomplex *
00138 , doublecomplex *, doublecomplex *, doublecomplex *, integer *, 
00139             doublecomplex *, integer *, doublecomplex *, integer *, 
00140             doublereal *, doublereal *, doublecomplex *, doublereal *, 
00141             integer *), zgttrf_(integer *, doublecomplex *, 
00142             doublecomplex *, doublecomplex *, doublecomplex *, integer *, 
00143             integer *), zgttrs_(char *, integer *, integer *, doublecomplex *, 
00144              doublecomplex *, doublecomplex *, doublecomplex *, integer *, 
00145             doublecomplex *, integer *, integer *);
00146 
00147     /* Fortran I/O blocks */
00148     static cilist io___29 = { 0, 0, 0, fmt_9999, 0 };
00149     static cilist io___39 = { 0, 0, 0, fmt_9997, 0 };
00150     static cilist io___44 = { 0, 0, 0, fmt_9998, 0 };
00151 
00152 
00153 
00154 /*  -- LAPACK test routine (version 3.1) -- */
00155 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00156 /*     November 2006 */
00157 
00158 /*     .. Scalar Arguments .. */
00159 /*     .. */
00160 /*     .. Array Arguments .. */
00161 /*     .. */
00162 
00163 /*  Purpose */
00164 /*  ======= */
00165 
00166 /*  ZCHKGT tests ZGTTRF, -TRS, -RFS, and -CON */
00167 
00168 /*  Arguments */
00169 /*  ========= */
00170 
00171 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00172 /*          The matrix types to be used for testing.  Matrices of type j */
00173 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00174 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00175 
00176 /*  NN      (input) INTEGER */
00177 /*          The number of values of N contained in the vector NVAL. */
00178 
00179 /*  NVAL    (input) INTEGER array, dimension (NN) */
00180 /*          The values of the matrix dimension N. */
00181 
00182 /*  NNS     (input) INTEGER */
00183 /*          The number of values of NRHS contained in the vector NSVAL. */
00184 
00185 /*  NSVAL   (input) INTEGER array, dimension (NNS) */
00186 /*          The values of the number of right hand sides NRHS. */
00187 
00188 /*  THRESH  (input) DOUBLE PRECISION */
00189 /*          The threshold value for the test ratios.  A result is */
00190 /*          included in the output file if RESULT >= THRESH.  To have */
00191 /*          every test ratio printed, use THRESH = 0. */
00192 
00193 /*  TSTERR  (input) LOGICAL */
00194 /*          Flag that indicates whether error exits are to be tested. */
00195 
00196 /*  A       (workspace) COMPLEX*16 array, dimension (NMAX*4) */
00197 
00198 /*  AF      (workspace) COMPLEX*16 array, dimension (NMAX*4) */
00199 
00200 /*  B       (workspace) COMPLEX*16 array, dimension (NMAX*NSMAX) */
00201 /*          where NSMAX is the largest entry in NSVAL. */
00202 
00203 /*  X       (workspace) COMPLEX*16 array, dimension (NMAX*NSMAX) */
00204 
00205 /*  XACT    (workspace) COMPLEX*16 array, dimension (NMAX*NSMAX) */
00206 
00207 /*  WORK    (workspace) COMPLEX*16 array, dimension */
00208 /*                      (NMAX*max(3,NSMAX)) */
00209 
00210 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension */
00211 /*                      (max(NMAX)+2*NSMAX) */
00212 
00213 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00214 
00215 /*  NOUT    (input) INTEGER */
00216 /*          The unit number for output. */
00217 
00218 /*  ===================================================================== */
00219 
00220 /*     .. Parameters .. */
00221 /*     .. */
00222 /*     .. Local Scalars .. */
00223 /*     .. */
00224 /*     .. Local Arrays .. */
00225 /*     .. */
00226 /*     .. External Functions .. */
00227 /*     .. */
00228 /*     .. External Subroutines .. */
00229 /*     .. */
00230 /*     .. Intrinsic Functions .. */
00231 /*     .. */
00232 /*     .. Scalars in Common .. */
00233 /*     .. */
00234 /*     .. Common blocks .. */
00235 /*     .. */
00236 /*     .. Data statements .. */
00237     /* Parameter adjustments */
00238     --iwork;
00239     --rwork;
00240     --work;
00241     --xact;
00242     --x;
00243     --b;
00244     --af;
00245     --a;
00246     --nsval;
00247     --nval;
00248     --dotype;
00249 
00250     /* Function Body */
00251 /*     .. */
00252 /*     .. Executable Statements .. */
00253 
00254     s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00255     s_copy(path + 1, "GT", (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         zerrge_(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 /* Computing MAX */
00278         i__2 = n - 1;
00279         m = max(i__2,0);
00280         lda = max(1,n);
00281         nimat = 12;
00282         if (n <= 0) {
00283             nimat = 1;
00284         }
00285 
00286         i__2 = nimat;
00287         for (imat = 1; imat <= i__2; ++imat) {
00288 
00289 /*           Do the tests only if DOTYPE( IMAT ) is true. */
00290 
00291             if (! dotype[imat]) {
00292                 goto L100;
00293             }
00294 
00295 /*           Set up parameters with ZLATB4. */
00296 
00297             zlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &mode, &
00298                     cond, dist);
00299 
00300             zerot = imat >= 8 && imat <= 10;
00301             if (imat <= 6) {
00302 
00303 /*              Types 1-6:  generate matrices of known condition number. */
00304 
00305 /* Computing MAX */
00306                 i__3 = 2 - ku, i__4 = 3 - max(1,n);
00307                 koff = max(i__3,i__4);
00308                 s_copy(srnamc_1.srnamt, "ZLATMS", (ftnlen)32, (ftnlen)6);
00309                 zlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &cond, 
00310                         &anorm, &kl, &ku, "Z", &af[koff], &c__3, &work[1], &
00311                         info);
00312 
00313 /*              Check the error code from ZLATMS. */
00314 
00315                 if (info != 0) {
00316                     alaerh_(path, "ZLATMS", &info, &c__0, " ", &n, &n, &kl, &
00317                             ku, &c_n1, &imat, &nfail, &nerrs, nout);
00318                     goto L100;
00319                 }
00320                 izero = 0;
00321 
00322                 if (n > 1) {
00323                     i__3 = n - 1;
00324                     zcopy_(&i__3, &af[4], &c__3, &a[1], &c__1);
00325                     i__3 = n - 1;
00326                     zcopy_(&i__3, &af[3], &c__3, &a[n + m + 1], &c__1);
00327                 }
00328                 zcopy_(&n, &af[2], &c__3, &a[m + 1], &c__1);
00329             } else {
00330 
00331 /*              Types 7-12:  generate tridiagonal matrices with */
00332 /*              unknown condition numbers. */
00333 
00334                 if (! zerot || ! dotype[7]) {
00335 
00336 /*                 Generate a matrix with elements whose real and */
00337 /*                 imaginary parts are from [-1,1]. */
00338 
00339                     i__3 = n + (m << 1);
00340                     zlarnv_(&c__2, iseed, &i__3, &a[1]);
00341                     if (anorm != 1.) {
00342                         i__3 = n + (m << 1);
00343                         zdscal_(&i__3, &anorm, &a[1], &c__1);
00344                     }
00345                 } else if (izero > 0) {
00346 
00347 /*                 Reuse the last matrix by copying back the zeroed out */
00348 /*                 elements. */
00349 
00350                     if (izero == 1) {
00351                         i__3 = n;
00352                         a[i__3].r = z__[1].r, a[i__3].i = z__[1].i;
00353                         if (n > 1) {
00354                             a[1].r = z__[2].r, a[1].i = z__[2].i;
00355                         }
00356                     } else if (izero == n) {
00357                         i__3 = n * 3 - 2;
00358                         a[i__3].r = z__[0].r, a[i__3].i = z__[0].i;
00359                         i__3 = (n << 1) - 1;
00360                         a[i__3].r = z__[1].r, a[i__3].i = z__[1].i;
00361                     } else {
00362                         i__3 = (n << 1) - 2 + izero;
00363                         a[i__3].r = z__[0].r, a[i__3].i = z__[0].i;
00364                         i__3 = n - 1 + izero;
00365                         a[i__3].r = z__[1].r, a[i__3].i = z__[1].i;
00366                         i__3 = izero;
00367                         a[i__3].r = z__[2].r, a[i__3].i = z__[2].i;
00368                     }
00369                 }
00370 
00371 /*              If IMAT > 7, set one column of the matrix to 0. */
00372 
00373                 if (! zerot) {
00374                     izero = 0;
00375                 } else if (imat == 8) {
00376                     izero = 1;
00377                     i__3 = n;
00378                     z__[1].r = a[i__3].r, z__[1].i = a[i__3].i;
00379                     i__3 = n;
00380                     a[i__3].r = 0., a[i__3].i = 0.;
00381                     if (n > 1) {
00382                         z__[2].r = a[1].r, z__[2].i = a[1].i;
00383                         a[1].r = 0., a[1].i = 0.;
00384                     }
00385                 } else if (imat == 9) {
00386                     izero = n;
00387                     i__3 = n * 3 - 2;
00388                     z__[0].r = a[i__3].r, z__[0].i = a[i__3].i;
00389                     i__3 = (n << 1) - 1;
00390                     z__[1].r = a[i__3].r, z__[1].i = a[i__3].i;
00391                     i__3 = n * 3 - 2;
00392                     a[i__3].r = 0., a[i__3].i = 0.;
00393                     i__3 = (n << 1) - 1;
00394                     a[i__3].r = 0., a[i__3].i = 0.;
00395                 } else {
00396                     izero = (n + 1) / 2;
00397                     i__3 = n - 1;
00398                     for (i__ = izero; i__ <= i__3; ++i__) {
00399                         i__4 = (n << 1) - 2 + i__;
00400                         a[i__4].r = 0., a[i__4].i = 0.;
00401                         i__4 = n - 1 + i__;
00402                         a[i__4].r = 0., a[i__4].i = 0.;
00403                         i__4 = i__;
00404                         a[i__4].r = 0., a[i__4].i = 0.;
00405 /* L20: */
00406                     }
00407                     i__3 = n * 3 - 2;
00408                     a[i__3].r = 0., a[i__3].i = 0.;
00409                     i__3 = (n << 1) - 1;
00410                     a[i__3].r = 0., a[i__3].i = 0.;
00411                 }
00412             }
00413 
00414 /* +    TEST 1 */
00415 /*           Factor A as L*U and compute the ratio */
00416 /*              norm(L*U - A) / (n * norm(A) * EPS ) */
00417 
00418             i__3 = n + (m << 1);
00419             zcopy_(&i__3, &a[1], &c__1, &af[1], &c__1);
00420             s_copy(srnamc_1.srnamt, "ZGTTRF", (ftnlen)32, (ftnlen)6);
00421             zgttrf_(&n, &af[1], &af[m + 1], &af[n + m + 1], &af[n + (m << 1) 
00422                     + 1], &iwork[1], &info);
00423 
00424 /*           Check error code from ZGTTRF. */
00425 
00426             if (info != izero) {
00427                 alaerh_(path, "ZGTTRF", &info, &izero, " ", &n, &n, &c__1, &
00428                         c__1, &c_n1, &imat, &nfail, &nerrs, nout);
00429             }
00430             trfcon = info != 0;
00431 
00432             zgtt01_(&n, &a[1], &a[m + 1], &a[n + m + 1], &af[1], &af[m + 1], &
00433                     af[n + m + 1], &af[n + (m << 1) + 1], &iwork[1], &work[1], 
00434                      &lda, &rwork[1], result);
00435 
00436 /*           Print the test ratio if it is .GE. THRESH. */
00437 
00438             if (result[0] >= *thresh) {
00439                 if (nfail == 0 && nerrs == 0) {
00440                     alahd_(nout, path);
00441                 }
00442                 io___29.ciunit = *nout;
00443                 s_wsfe(&io___29);
00444                 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00445                 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00446                 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00447                 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(doublereal));
00448                 e_wsfe();
00449                 ++nfail;
00450             }
00451             ++nrun;
00452 
00453             for (itran = 1; itran <= 2; ++itran) {
00454                 *(unsigned char *)trans = *(unsigned char *)&transs[itran - 1]
00455                         ;
00456                 if (itran == 1) {
00457                     *(unsigned char *)norm = 'O';
00458                 } else {
00459                     *(unsigned char *)norm = 'I';
00460                 }
00461                 anorm = zlangt_(norm, &n, &a[1], &a[m + 1], &a[n + m + 1]);
00462 
00463                 if (! trfcon) {
00464 
00465 /*                 Use ZGTTRS to solve for one column at a time of */
00466 /*                 inv(A), computing the maximum column sum as we go. */
00467 
00468                     ainvnm = 0.;
00469                     i__3 = n;
00470                     for (i__ = 1; i__ <= i__3; ++i__) {
00471                         i__4 = n;
00472                         for (j = 1; j <= i__4; ++j) {
00473                             i__5 = j;
00474                             x[i__5].r = 0., x[i__5].i = 0.;
00475 /* L30: */
00476                         }
00477                         i__4 = i__;
00478                         x[i__4].r = 1., x[i__4].i = 0.;
00479                         zgttrs_(trans, &n, &c__1, &af[1], &af[m + 1], &af[n + 
00480                                 m + 1], &af[n + (m << 1) + 1], &iwork[1], &x[
00481                                 1], &lda, &info);
00482 /* Computing MAX */
00483                         d__1 = ainvnm, d__2 = dzasum_(&n, &x[1], &c__1);
00484                         ainvnm = max(d__1,d__2);
00485 /* L40: */
00486                     }
00487 
00488 /*                 Compute RCONDC = 1 / (norm(A) * norm(inv(A)) */
00489 
00490                     if (anorm <= 0. || ainvnm <= 0.) {
00491                         rcondc = 1.;
00492                     } else {
00493                         rcondc = 1. / anorm / ainvnm;
00494                     }
00495                     if (itran == 1) {
00496                         rcondo = rcondc;
00497                     } else {
00498                         rcondi = rcondc;
00499                     }
00500                 } else {
00501                     rcondc = 0.;
00502                 }
00503 
00504 /* +    TEST 7 */
00505 /*              Estimate the reciprocal of the condition number of the */
00506 /*              matrix. */
00507 
00508                 s_copy(srnamc_1.srnamt, "ZGTCON", (ftnlen)32, (ftnlen)6);
00509                 zgtcon_(norm, &n, &af[1], &af[m + 1], &af[n + m + 1], &af[n + 
00510                         (m << 1) + 1], &iwork[1], &anorm, &rcond, &work[1], &
00511                         info);
00512 
00513 /*              Check error code from ZGTCON. */
00514 
00515                 if (info != 0) {
00516                     alaerh_(path, "ZGTCON", &info, &c__0, norm, &n, &n, &c_n1, 
00517                              &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00518                 }
00519 
00520                 result[6] = dget06_(&rcond, &rcondc);
00521 
00522 /*              Print the test ratio if it is .GE. THRESH. */
00523 
00524                 if (result[6] >= *thresh) {
00525                     if (nfail == 0 && nerrs == 0) {
00526                         alahd_(nout, path);
00527                     }
00528                     io___39.ciunit = *nout;
00529                     s_wsfe(&io___39);
00530                     do_fio(&c__1, norm, (ftnlen)1);
00531                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00532                     do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00533                     do_fio(&c__1, (char *)&c__7, (ftnlen)sizeof(integer));
00534                     do_fio(&c__1, (char *)&result[6], (ftnlen)sizeof(
00535                             doublereal));
00536                     e_wsfe();
00537                     ++nfail;
00538                 }
00539                 ++nrun;
00540 /* L50: */
00541             }
00542 
00543 /*           Skip the remaining tests if the matrix is singular. */
00544 
00545             if (trfcon) {
00546                 goto L100;
00547             }
00548 
00549             i__3 = *nns;
00550             for (irhs = 1; irhs <= i__3; ++irhs) {
00551                 nrhs = nsval[irhs];
00552 
00553 /*              Generate NRHS random solution vectors. */
00554 
00555                 ix = 1;
00556                 i__4 = nrhs;
00557                 for (j = 1; j <= i__4; ++j) {
00558                     zlarnv_(&c__2, iseed, &n, &xact[ix]);
00559                     ix += lda;
00560 /* L60: */
00561                 }
00562 
00563                 for (itran = 1; itran <= 3; ++itran) {
00564                     *(unsigned char *)trans = *(unsigned char *)&transs[itran 
00565                             - 1];
00566                     if (itran == 1) {
00567                         rcondc = rcondo;
00568                     } else {
00569                         rcondc = rcondi;
00570                     }
00571 
00572 /*                 Set the right hand side. */
00573 
00574                     zlagtm_(trans, &n, &nrhs, &c_b63, &a[1], &a[m + 1], &a[n 
00575                             + m + 1], &xact[1], &lda, &c_b64, &b[1], &lda);
00576 
00577 /* +    TEST 2 */
00578 /*              Solve op(A) * X = B and compute the residual. */
00579 
00580                     zlacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &lda);
00581                     s_copy(srnamc_1.srnamt, "ZGTTRS", (ftnlen)32, (ftnlen)6);
00582                     zgttrs_(trans, &n, &nrhs, &af[1], &af[m + 1], &af[n + m + 
00583                             1], &af[n + (m << 1) + 1], &iwork[1], &x[1], &lda, 
00584                              &info);
00585 
00586 /*              Check error code from ZGTTRS. */
00587 
00588                     if (info != 0) {
00589                         alaerh_(path, "ZGTTRS", &info, &c__0, trans, &n, &n, &
00590                                 c_n1, &c_n1, &nrhs, &imat, &nfail, &nerrs, 
00591                                 nout);
00592                     }
00593 
00594                     zlacpy_("Full", &n, &nrhs, &b[1], &lda, &work[1], &lda);
00595                     zgtt02_(trans, &n, &nrhs, &a[1], &a[m + 1], &a[n + m + 1], 
00596                              &x[1], &lda, &work[1], &lda, &rwork[1], &result[
00597                             1]);
00598 
00599 /* +    TEST 3 */
00600 /*              Check solution from generated exact solution. */
00601 
00602                     zget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &rcondc, &
00603                             result[2]);
00604 
00605 /* +    TESTS 4, 5, and 6 */
00606 /*              Use iterative refinement to improve the solution. */
00607 
00608                     s_copy(srnamc_1.srnamt, "ZGTRFS", (ftnlen)32, (ftnlen)6);
00609                     zgtrfs_(trans, &n, &nrhs, &a[1], &a[m + 1], &a[n + m + 1], 
00610                              &af[1], &af[m + 1], &af[n + m + 1], &af[n + (m <<
00611                              1) + 1], &iwork[1], &b[1], &lda, &x[1], &lda, &
00612                             rwork[1], &rwork[nrhs + 1], &work[1], &rwork[(
00613                             nrhs << 1) + 1], &info);
00614 
00615 /*              Check error code from ZGTRFS. */
00616 
00617                     if (info != 0) {
00618                         alaerh_(path, "ZGTRFS", &info, &c__0, trans, &n, &n, &
00619                                 c_n1, &c_n1, &nrhs, &imat, &nfail, &nerrs, 
00620                                 nout);
00621                     }
00622 
00623                     zget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &rcondc, &
00624                             result[3]);
00625                     zgtt05_(trans, &n, &nrhs, &a[1], &a[m + 1], &a[n + m + 1], 
00626                              &b[1], &lda, &x[1], &lda, &xact[1], &lda, &rwork[
00627                             1], &rwork[nrhs + 1], &result[4]);
00628 
00629 /*              Print information about the tests that did not pass the */
00630 /*              threshold. */
00631 
00632                     for (k = 2; k <= 6; ++k) {
00633                         if (result[k - 1] >= *thresh) {
00634                             if (nfail == 0 && nerrs == 0) {
00635                                 alahd_(nout, path);
00636                             }
00637                             io___44.ciunit = *nout;
00638                             s_wsfe(&io___44);
00639                             do_fio(&c__1, trans, (ftnlen)1);
00640                             do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00641                                     ;
00642                             do_fio(&c__1, (char *)&nrhs, (ftnlen)sizeof(
00643                                     integer));
00644                             do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00645                                     integer));
00646                             do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer))
00647                                     ;
00648                             do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00649                                     sizeof(doublereal));
00650                             e_wsfe();
00651                             ++nfail;
00652                         }
00653 /* L70: */
00654                     }
00655                     nrun += 5;
00656 /* L80: */
00657                 }
00658 /* L90: */
00659             }
00660 L100:
00661             ;
00662         }
00663 /* L110: */
00664     }
00665 
00666 /*     Print a summary of the results. */
00667 
00668     alasum_(path, nout, &nfail, &nrun, &nerrs);
00669 
00670     return 0;
00671 
00672 /*     End of ZCHKGT */
00673 
00674 } /* zchkgt_ */


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