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


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