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


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