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


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