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


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