zdrvpp.c
Go to the documentation of this file.
00001 /* zdrvpp.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__0 = 0;
00034 static integer c_n1 = -1;
00035 static integer c__2 = 2;
00036 static integer c__1 = 1;
00037 static doublecomplex c_b63 = {0.,0.};
00038 
00039 /* Subroutine */ int zdrvpp_(logical *dotype, integer *nn, integer *nval, 
00040         integer *nrhs, doublereal *thresh, logical *tsterr, integer *nmax, 
00041         doublecomplex *a, doublecomplex *afac, doublecomplex *asav, 
00042         doublecomplex *b, doublecomplex *bsav, doublecomplex *x, 
00043         doublecomplex *xact, doublereal *s, doublecomplex *work, doublereal *
00044         rwork, integer *nout)
00045 {
00046     /* Initialized data */
00047 
00048     static integer iseedy[4] = { 1988,1989,1990,1991 };
00049     static char uplos[1*2] = "U" "L";
00050     static char facts[1*3] = "F" "N" "E";
00051     static char packs[1*2] = "C" "R";
00052     static char equeds[1*2] = "N" "Y";
00053 
00054     /* Format strings */
00055     static char fmt_9999[] = "(1x,a,\002, UPLO='\002,a1,\002', N =\002,i5"
00056             ",\002, type \002,i1,\002, test(\002,i1,\002)=\002,g12.5)";
00057     static char fmt_9997[] = "(1x,a,\002, FACT='\002,a1,\002', UPLO='\002,"
00058             "a1,\002', N=\002,i5,\002, EQUED='\002,a1,\002', type \002,i1,"
00059             "\002, test(\002,i1,\002)=\002,g12.5)";
00060     static char fmt_9998[] = "(1x,a,\002, FACT='\002,a1,\002', UPLO='\002,"
00061             "a1,\002', N=\002,i5,\002, type \002,i1,\002, test(\002,i1,\002)"
00062             "=\002,g12.5)";
00063 
00064     /* System generated locals */
00065     address a__1[2];
00066     integer i__1, i__2, i__3, i__4, i__5[2];
00067     char ch__1[2];
00068 
00069     /* Builtin functions */
00070     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00071     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00072     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
00073 
00074     /* Local variables */
00075     integer i__, k, n, k1, in, kl, ku, nt, lda, npp;
00076     char fact[1];
00077     integer ioff, mode;
00078     doublereal amax;
00079     char path[3];
00080     integer imat, info;
00081     char dist[1], uplo[1], type__[1];
00082     integer nrun, ifact, nfail, iseed[4], nfact;
00083     extern doublereal dget06_(doublereal *, doublereal *);
00084     extern logical lsame_(char *, char *);
00085     char equed[1];
00086     doublereal roldc, rcond, scond;
00087     integer nimat;
00088     doublereal anorm;
00089     extern /* Subroutine */ int zget04_(integer *, integer *, doublecomplex *, 
00090              integer *, doublecomplex *, integer *, doublereal *, doublereal *
00091 );
00092     logical equil;
00093     integer iuplo, izero, nerrs;
00094     extern /* Subroutine */ int zppt01_(char *, integer *, doublecomplex *, 
00095             doublecomplex *, doublereal *, doublereal *), zppt02_(
00096             char *, integer *, integer *, doublecomplex *, doublecomplex *, 
00097             integer *, doublecomplex *, integer *, doublereal *, doublereal *);
00098     logical zerot;
00099     extern /* Subroutine */ int zcopy_(integer *, doublecomplex *, integer *, 
00100             doublecomplex *, integer *), zppt05_(char *, integer *, integer *, 
00101              doublecomplex *, doublecomplex *, integer *, doublecomplex *, 
00102             integer *, doublecomplex *, integer *, doublereal *, doublereal *, 
00103              doublereal *);
00104     char xtype[1];
00105     extern /* Subroutine */ int zppsv_(char *, integer *, integer *, 
00106             doublecomplex *, doublecomplex *, integer *, integer *), 
00107             zlatb4_(char *, integer *, integer *, integer *, char *, integer *
00108 , integer *, doublereal *, integer *, doublereal *, char *), aladhd_(integer *, char *), 
00109             alaerh_(char *, char *, integer *, integer *, char *, integer *, 
00110             integer *, integer *, integer *, integer *, integer *, integer *, 
00111             integer *, integer *);
00112     logical prefac;
00113     doublereal rcondc;
00114     logical nofact;
00115     char packit[1];
00116     integer iequed;
00117     extern /* Subroutine */ int alasvm_(char *, integer *, integer *, integer 
00118             *, integer *);
00119     doublereal cndnum;
00120     extern /* Subroutine */ int zlaipd_(integer *, doublecomplex *, integer *, 
00121              integer *);
00122     doublereal ainvnm;
00123     extern doublereal zlanhp_(char *, char *, integer *, doublecomplex *, 
00124             doublereal *);
00125     extern /* Subroutine */ int zlaqhp_(char *, integer *, doublecomplex *, 
00126             doublereal *, doublereal *, doublereal *, char *),
00127              zlacpy_(char *, integer *, integer *, doublecomplex *, integer *, 
00128              doublecomplex *, integer *), zlarhs_(char *, char *, 
00129             char *, char *, integer *, integer *, integer *, integer *, 
00130             integer *, doublecomplex *, integer *, doublecomplex *, integer *, 
00131              doublecomplex *, integer *, integer *, integer *), zlaset_(char *, integer *, integer *, 
00132             doublecomplex *, doublecomplex *, doublecomplex *, integer *), zlatms_(integer *, integer *, char *, integer *, char *, 
00133             doublereal *, integer *, doublereal *, doublereal *, integer *, 
00134             integer *, char *, doublecomplex *, integer *, doublecomplex *, 
00135             integer *);
00136     doublereal result[6];
00137     extern /* Subroutine */ int zppequ_(char *, integer *, doublecomplex *, 
00138             doublereal *, doublereal *, doublereal *, integer *), 
00139             zpptrf_(char *, integer *, doublecomplex *, integer *), 
00140             zpptri_(char *, integer *, doublecomplex *, integer *), 
00141             zerrvx_(char *, integer *), zppsvx_(char *, char *, 
00142             integer *, integer *, doublecomplex *, doublecomplex *, char *, 
00143             doublereal *, doublecomplex *, integer *, doublecomplex *, 
00144             integer *, doublereal *, doublereal *, doublereal *, 
00145             doublecomplex *, doublereal *, integer *);
00146 
00147     /* Fortran I/O blocks */
00148     static cilist io___49 = { 0, 0, 0, fmt_9999, 0 };
00149     static cilist io___52 = { 0, 0, 0, fmt_9997, 0 };
00150     static cilist io___53 = { 0, 0, 0, fmt_9998, 0 };
00151 
00152 
00153 
00154 /*  -- LAPACK test routine (version 3.1) -- */
00155 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00156 /*     November 2006 */
00157 
00158 /*     .. Scalar Arguments .. */
00159 /*     .. */
00160 /*     .. Array Arguments .. */
00161 /*     .. */
00162 
00163 /*  Purpose */
00164 /*  ======= */
00165 
00166 /*  ZDRVPP tests the driver routines ZPPSV and -SVX. */
00167 
00168 /*  Arguments */
00169 /*  ========= */
00170 
00171 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00172 /*          The matrix types to be used for testing.  Matrices of type j */
00173 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00174 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00175 
00176 /*  NN      (input) INTEGER */
00177 /*          The number of values of N contained in the vector NVAL. */
00178 
00179 /*  NVAL    (input) INTEGER array, dimension (NN) */
00180 /*          The values of the matrix dimension N. */
00181 
00182 /*  NRHS    (input) INTEGER */
00183 /*          The number of right hand side vectors to be generated for */
00184 /*          each linear system. */
00185 
00186 /*  THRESH  (input) DOUBLE PRECISION */
00187 /*          The threshold value for the test ratios.  A result is */
00188 /*          included in the output file if RESULT >= THRESH.  To have */
00189 /*          every test ratio printed, use THRESH = 0. */
00190 
00191 /*  TSTERR  (input) LOGICAL */
00192 /*          Flag that indicates whether error exits are to be tested. */
00193 
00194 /*  NMAX    (input) INTEGER */
00195 /*          The maximum value permitted for N, used in dimensioning the */
00196 /*          work arrays. */
00197 
00198 /*  A       (workspace) COMPLEX*16 array, dimension (NMAX*(NMAX+1)/2) */
00199 
00200 /*  AFAC    (workspace) COMPLEX*16 array, dimension (NMAX*(NMAX+1)/2) */
00201 
00202 /*  ASAV    (workspace) COMPLEX*16 array, dimension (NMAX*(NMAX+1)/2) */
00203 
00204 /*  B       (workspace) COMPLEX*16 array, dimension (NMAX*NRHS) */
00205 
00206 /*  BSAV    (workspace) COMPLEX*16 array, dimension (NMAX*NRHS) */
00207 
00208 /*  X       (workspace) COMPLEX*16 array, dimension (NMAX*NRHS) */
00209 
00210 /*  XACT    (workspace) COMPLEX*16 array, dimension (NMAX*NRHS) */
00211 
00212 /*  S       (workspace) DOUBLE PRECISION array, dimension (NMAX) */
00213 
00214 /*  WORK    (workspace) COMPLEX*16 array, dimension */
00215 /*                      (NMAX*max(3,NRHS)) */
00216 
00217 /*  RWORK   (workspace) DOUBLE PRECISION array, dimension (NMAX+2*NRHS) */
00218 
00219 /*  NOUT    (input) INTEGER */
00220 /*          The unit number for output. */
00221 
00222 /*  ===================================================================== */
00223 
00224 /*     .. Parameters .. */
00225 /*     .. */
00226 /*     .. Local Scalars .. */
00227 /*     .. */
00228 /*     .. Local Arrays .. */
00229 /*     .. */
00230 /*     .. External Functions .. */
00231 /*     .. */
00232 /*     .. External Subroutines .. */
00233 /*     .. */
00234 /*     .. Scalars in Common .. */
00235 /*     .. */
00236 /*     .. Common blocks .. */
00237 /*     .. */
00238 /*     .. Intrinsic Functions .. */
00239 /*     .. */
00240 /*     .. Data statements .. */
00241     /* Parameter adjustments */
00242     --rwork;
00243     --work;
00244     --s;
00245     --xact;
00246     --x;
00247     --bsav;
00248     --b;
00249     --asav;
00250     --afac;
00251     --a;
00252     --nval;
00253     --dotype;
00254 
00255     /* Function Body */
00256 /*     .. */
00257 /*     .. Executable Statements .. */
00258 
00259 /*     Initialize constants and the random number seed. */
00260 
00261     s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00262     s_copy(path + 1, "PP", (ftnlen)2, (ftnlen)2);
00263     nrun = 0;
00264     nfail = 0;
00265     nerrs = 0;
00266     for (i__ = 1; i__ <= 4; ++i__) {
00267         iseed[i__ - 1] = iseedy[i__ - 1];
00268 /* L10: */
00269     }
00270 
00271 /*     Test the error exits */
00272 
00273     if (*tsterr) {
00274         zerrvx_(path, nout);
00275     }
00276     infoc_1.infot = 0;
00277 
00278 /*     Do for each value of N in NVAL */
00279 
00280     i__1 = *nn;
00281     for (in = 1; in <= i__1; ++in) {
00282         n = nval[in];
00283         lda = max(n,1);
00284         npp = n * (n + 1) / 2;
00285         *(unsigned char *)xtype = 'N';
00286         nimat = 9;
00287         if (n <= 0) {
00288             nimat = 1;
00289         }
00290 
00291         i__2 = nimat;
00292         for (imat = 1; imat <= i__2; ++imat) {
00293 
00294 /*           Do the tests only if DOTYPE( IMAT ) is true. */
00295 
00296             if (! dotype[imat]) {
00297                 goto L130;
00298             }
00299 
00300 /*           Skip types 3, 4, or 5 if the matrix size is too small. */
00301 
00302             zerot = imat >= 3 && imat <= 5;
00303             if (zerot && n < imat - 2) {
00304                 goto L130;
00305             }
00306 
00307 /*           Do first for UPLO = 'U', then for UPLO = 'L' */
00308 
00309             for (iuplo = 1; iuplo <= 2; ++iuplo) {
00310                 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00311                 *(unsigned char *)packit = *(unsigned char *)&packs[iuplo - 1]
00312                         ;
00313 
00314 /*              Set up parameters with ZLATB4 and generate a test matrix */
00315 /*              with ZLATMS. */
00316 
00317                 zlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &mode, 
00318                         &cndnum, dist);
00319                 rcondc = 1. / cndnum;
00320 
00321                 s_copy(srnamc_1.srnamt, "ZLATMS", (ftnlen)32, (ftnlen)6);
00322                 zlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00323                         cndnum, &anorm, &kl, &ku, packit, &a[1], &lda, &work[
00324                         1], &info);
00325 
00326 /*              Check error code from ZLATMS. */
00327 
00328                 if (info != 0) {
00329                     alaerh_(path, "ZLATMS", &info, &c__0, uplo, &n, &n, &c_n1, 
00330                              &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00331                     goto L120;
00332                 }
00333 
00334 /*              For types 3-5, zero one row and column of the matrix to */
00335 /*              test that INFO is returned correctly. */
00336 
00337                 if (zerot) {
00338                     if (imat == 3) {
00339                         izero = 1;
00340                     } else if (imat == 4) {
00341                         izero = n;
00342                     } else {
00343                         izero = n / 2 + 1;
00344                     }
00345 
00346 /*                 Set row and column IZERO of A to 0. */
00347 
00348                     if (iuplo == 1) {
00349                         ioff = (izero - 1) * izero / 2;
00350                         i__3 = izero - 1;
00351                         for (i__ = 1; i__ <= i__3; ++i__) {
00352                             i__4 = ioff + i__;
00353                             a[i__4].r = 0., a[i__4].i = 0.;
00354 /* L20: */
00355                         }
00356                         ioff += izero;
00357                         i__3 = n;
00358                         for (i__ = izero; i__ <= i__3; ++i__) {
00359                             i__4 = ioff;
00360                             a[i__4].r = 0., a[i__4].i = 0.;
00361                             ioff += i__;
00362 /* L30: */
00363                         }
00364                     } else {
00365                         ioff = izero;
00366                         i__3 = izero - 1;
00367                         for (i__ = 1; i__ <= i__3; ++i__) {
00368                             i__4 = ioff;
00369                             a[i__4].r = 0., a[i__4].i = 0.;
00370                             ioff = ioff + n - i__;
00371 /* L40: */
00372                         }
00373                         ioff -= izero;
00374                         i__3 = n;
00375                         for (i__ = izero; i__ <= i__3; ++i__) {
00376                             i__4 = ioff + i__;
00377                             a[i__4].r = 0., a[i__4].i = 0.;
00378 /* L50: */
00379                         }
00380                     }
00381                 } else {
00382                     izero = 0;
00383                 }
00384 
00385 /*              Set the imaginary part of the diagonals. */
00386 
00387                 if (iuplo == 1) {
00388                     zlaipd_(&n, &a[1], &c__2, &c__1);
00389                 } else {
00390                     zlaipd_(&n, &a[1], &n, &c_n1);
00391                 }
00392 
00393 /*              Save a copy of the matrix A in ASAV. */
00394 
00395                 zcopy_(&npp, &a[1], &c__1, &asav[1], &c__1);
00396 
00397                 for (iequed = 1; iequed <= 2; ++iequed) {
00398                     *(unsigned char *)equed = *(unsigned char *)&equeds[
00399                             iequed - 1];
00400                     if (iequed == 1) {
00401                         nfact = 3;
00402                     } else {
00403                         nfact = 1;
00404                     }
00405 
00406                     i__3 = nfact;
00407                     for (ifact = 1; ifact <= i__3; ++ifact) {
00408                         *(unsigned char *)fact = *(unsigned char *)&facts[
00409                                 ifact - 1];
00410                         prefac = lsame_(fact, "F");
00411                         nofact = lsame_(fact, "N");
00412                         equil = lsame_(fact, "E");
00413 
00414                         if (zerot) {
00415                             if (prefac) {
00416                                 goto L100;
00417                             }
00418                             rcondc = 0.;
00419 
00420                         } else if (! lsame_(fact, "N")) 
00421                                 {
00422 
00423 /*                       Compute the condition number for comparison with */
00424 /*                       the value returned by ZPPSVX (FACT = 'N' reuses */
00425 /*                       the condition number from the previous iteration */
00426 /*                          with FACT = 'F'). */
00427 
00428                             zcopy_(&npp, &asav[1], &c__1, &afac[1], &c__1);
00429                             if (equil || iequed > 1) {
00430 
00431 /*                          Compute row and column scale factors to */
00432 /*                          equilibrate the matrix A. */
00433 
00434                                 zppequ_(uplo, &n, &afac[1], &s[1], &scond, &
00435                                         amax, &info);
00436                                 if (info == 0 && n > 0) {
00437                                     if (iequed > 1) {
00438                                         scond = 0.;
00439                                     }
00440 
00441 /*                             Equilibrate the matrix. */
00442 
00443                                     zlaqhp_(uplo, &n, &afac[1], &s[1], &scond, 
00444                                              &amax, equed);
00445                                 }
00446                             }
00447 
00448 /*                       Save the condition number of the */
00449 /*                       non-equilibrated system for use in ZGET04. */
00450 
00451                             if (equil) {
00452                                 roldc = rcondc;
00453                             }
00454 
00455 /*                       Compute the 1-norm of A. */
00456 
00457                             anorm = zlanhp_("1", uplo, &n, &afac[1], &rwork[1]
00458 );
00459 
00460 /*                       Factor the matrix A. */
00461 
00462                             zpptrf_(uplo, &n, &afac[1], &info);
00463 
00464 /*                       Form the inverse of A. */
00465 
00466                             zcopy_(&npp, &afac[1], &c__1, &a[1], &c__1);
00467                             zpptri_(uplo, &n, &a[1], &info);
00468 
00469 /*                       Compute the 1-norm condition number of A. */
00470 
00471                             ainvnm = zlanhp_("1", uplo, &n, &a[1], &rwork[1]);
00472                             if (anorm <= 0. || ainvnm <= 0.) {
00473                                 rcondc = 1.;
00474                             } else {
00475                                 rcondc = 1. / anorm / ainvnm;
00476                             }
00477                         }
00478 
00479 /*                    Restore the matrix A. */
00480 
00481                         zcopy_(&npp, &asav[1], &c__1, &a[1], &c__1);
00482 
00483 /*                    Form an exact solution and set the right hand side. */
00484 
00485                         s_copy(srnamc_1.srnamt, "ZLARHS", (ftnlen)32, (ftnlen)
00486                                 6);
00487                         zlarhs_(path, xtype, uplo, " ", &n, &n, &kl, &ku, 
00488                                 nrhs, &a[1], &lda, &xact[1], &lda, &b[1], &
00489                                 lda, iseed, &info);
00490                         *(unsigned char *)xtype = 'C';
00491                         zlacpy_("Full", &n, nrhs, &b[1], &lda, &bsav[1], &lda);
00492 
00493                         if (nofact) {
00494 
00495 /*                       --- Test ZPPSV  --- */
00496 
00497 /*                       Compute the L*L' or U'*U factorization of the */
00498 /*                       matrix and solve the system. */
00499 
00500                             zcopy_(&npp, &a[1], &c__1, &afac[1], &c__1);
00501                             zlacpy_("Full", &n, nrhs, &b[1], &lda, &x[1], &
00502                                     lda);
00503 
00504                             s_copy(srnamc_1.srnamt, "ZPPSV ", (ftnlen)32, (
00505                                     ftnlen)6);
00506                             zppsv_(uplo, &n, nrhs, &afac[1], &x[1], &lda, &
00507                                     info);
00508 
00509 /*                       Check error code from ZPPSV . */
00510 
00511                             if (info != izero) {
00512                                 alaerh_(path, "ZPPSV ", &info, &izero, uplo, &
00513                                         n, &n, &c_n1, &c_n1, nrhs, &imat, &
00514                                         nfail, &nerrs, nout);
00515                                 goto L70;
00516                             } else if (info != 0) {
00517                                 goto L70;
00518                             }
00519 
00520 /*                       Reconstruct matrix from factors and compute */
00521 /*                       residual. */
00522 
00523                             zppt01_(uplo, &n, &a[1], &afac[1], &rwork[1], 
00524                                     result);
00525 
00526 /*                       Compute residual of the computed solution. */
00527 
00528                             zlacpy_("Full", &n, nrhs, &b[1], &lda, &work[1], &
00529                                     lda);
00530                             zppt02_(uplo, &n, nrhs, &a[1], &x[1], &lda, &work[
00531                                     1], &lda, &rwork[1], &result[1]);
00532 
00533 /*                       Check solution from generated exact solution. */
00534 
00535                             zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda, &
00536                                     rcondc, &result[2]);
00537                             nt = 3;
00538 
00539 /*                       Print information about the tests that did not */
00540 /*                       pass the threshold. */
00541 
00542                             i__4 = nt;
00543                             for (k = 1; k <= i__4; ++k) {
00544                                 if (result[k - 1] >= *thresh) {
00545                                     if (nfail == 0 && nerrs == 0) {
00546                                         aladhd_(nout, path);
00547                                     }
00548                                     io___49.ciunit = *nout;
00549                                     s_wsfe(&io___49);
00550                                     do_fio(&c__1, "ZPPSV ", (ftnlen)6);
00551                                     do_fio(&c__1, uplo, (ftnlen)1);
00552                                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00553                                             integer));
00554                                     do_fio(&c__1, (char *)&imat, (ftnlen)
00555                                             sizeof(integer));
00556                                     do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00557                                             integer));
00558                                     do_fio(&c__1, (char *)&result[k - 1], (
00559                                             ftnlen)sizeof(doublereal));
00560                                     e_wsfe();
00561                                     ++nfail;
00562                                 }
00563 /* L60: */
00564                             }
00565                             nrun += nt;
00566 L70:
00567                             ;
00568                         }
00569 
00570 /*                    --- Test ZPPSVX --- */
00571 
00572                         if (! prefac && npp > 0) {
00573                             zlaset_("Full", &npp, &c__1, &c_b63, &c_b63, &
00574                                     afac[1], &npp);
00575                         }
00576                         zlaset_("Full", &n, nrhs, &c_b63, &c_b63, &x[1], &lda);
00577                         if (iequed > 1 && n > 0) {
00578 
00579 /*                       Equilibrate the matrix if FACT='F' and */
00580 /*                       EQUED='Y'. */
00581 
00582                             zlaqhp_(uplo, &n, &a[1], &s[1], &scond, &amax, 
00583                                     equed);
00584                         }
00585 
00586 /*                    Solve the system and compute the condition number */
00587 /*                    and error bounds using ZPPSVX. */
00588 
00589                         s_copy(srnamc_1.srnamt, "ZPPSVX", (ftnlen)32, (ftnlen)
00590                                 6);
00591                         zppsvx_(fact, uplo, &n, nrhs, &a[1], &afac[1], equed, 
00592                                 &s[1], &b[1], &lda, &x[1], &lda, &rcond, &
00593                                 rwork[1], &rwork[*nrhs + 1], &work[1], &rwork[
00594                                 (*nrhs << 1) + 1], &info);
00595 
00596 /*                    Check the error code from ZPPSVX. */
00597 
00598                         if (info != izero) {
00599 /* Writing concatenation */
00600                             i__5[0] = 1, a__1[0] = fact;
00601                             i__5[1] = 1, a__1[1] = uplo;
00602                             s_cat(ch__1, a__1, i__5, &c__2, (ftnlen)2);
00603                             alaerh_(path, "ZPPSVX", &info, &izero, ch__1, &n, 
00604                                     &n, &c_n1, &c_n1, nrhs, &imat, &nfail, &
00605                                     nerrs, nout);
00606                             goto L90;
00607                         }
00608 
00609                         if (info == 0) {
00610                             if (! prefac) {
00611 
00612 /*                          Reconstruct matrix from factors and compute */
00613 /*                          residual. */
00614 
00615                                 zppt01_(uplo, &n, &a[1], &afac[1], &rwork[(*
00616                                         nrhs << 1) + 1], result);
00617                                 k1 = 1;
00618                             } else {
00619                                 k1 = 2;
00620                             }
00621 
00622 /*                       Compute residual of the computed solution. */
00623 
00624                             zlacpy_("Full", &n, nrhs, &bsav[1], &lda, &work[1]
00625 , &lda);
00626                             zppt02_(uplo, &n, nrhs, &asav[1], &x[1], &lda, &
00627                                     work[1], &lda, &rwork[(*nrhs << 1) + 1], &
00628                                     result[1]);
00629 
00630 /*                       Check solution from generated exact solution. */
00631 
00632                             if (nofact || prefac && lsame_(equed, "N")) {
00633                                 zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda, 
00634                                          &rcondc, &result[2]);
00635                             } else {
00636                                 zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda, 
00637                                          &roldc, &result[2]);
00638                             }
00639 
00640 /*                       Check the error bounds from iterative */
00641 /*                       refinement. */
00642 
00643                             zppt05_(uplo, &n, nrhs, &asav[1], &b[1], &lda, &x[
00644                                     1], &lda, &xact[1], &lda, &rwork[1], &
00645                                     rwork[*nrhs + 1], &result[3]);
00646                         } else {
00647                             k1 = 6;
00648                         }
00649 
00650 /*                    Compare RCOND from ZPPSVX with the computed value */
00651 /*                    in RCONDC. */
00652 
00653                         result[5] = dget06_(&rcond, &rcondc);
00654 
00655 /*                    Print information about the tests that did not pass */
00656 /*                    the threshold. */
00657 
00658                         for (k = k1; k <= 6; ++k) {
00659                             if (result[k - 1] >= *thresh) {
00660                                 if (nfail == 0 && nerrs == 0) {
00661                                     aladhd_(nout, path);
00662                                 }
00663                                 if (prefac) {
00664                                     io___52.ciunit = *nout;
00665                                     s_wsfe(&io___52);
00666                                     do_fio(&c__1, "ZPPSVX", (ftnlen)6);
00667                                     do_fio(&c__1, fact, (ftnlen)1);
00668                                     do_fio(&c__1, uplo, (ftnlen)1);
00669                                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00670                                             integer));
00671                                     do_fio(&c__1, equed, (ftnlen)1);
00672                                     do_fio(&c__1, (char *)&imat, (ftnlen)
00673                                             sizeof(integer));
00674                                     do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00675                                             integer));
00676                                     do_fio(&c__1, (char *)&result[k - 1], (
00677                                             ftnlen)sizeof(doublereal));
00678                                     e_wsfe();
00679                                 } else {
00680                                     io___53.ciunit = *nout;
00681                                     s_wsfe(&io___53);
00682                                     do_fio(&c__1, "ZPPSVX", (ftnlen)6);
00683                                     do_fio(&c__1, fact, (ftnlen)1);
00684                                     do_fio(&c__1, uplo, (ftnlen)1);
00685                                     do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00686                                             integer));
00687                                     do_fio(&c__1, (char *)&imat, (ftnlen)
00688                                             sizeof(integer));
00689                                     do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00690                                             integer));
00691                                     do_fio(&c__1, (char *)&result[k - 1], (
00692                                             ftnlen)sizeof(doublereal));
00693                                     e_wsfe();
00694                                 }
00695                                 ++nfail;
00696                             }
00697 /* L80: */
00698                         }
00699                         nrun = nrun + 7 - k1;
00700 L90:
00701 L100:
00702                         ;
00703                     }
00704 /* L110: */
00705                 }
00706 L120:
00707                 ;
00708             }
00709 L130:
00710             ;
00711         }
00712 /* L140: */
00713     }
00714 
00715 /*     Print a summary of the results. */
00716 
00717     alasvm_(path, nout, &nfail, &nrun, &nerrs);
00718 
00719     return 0;
00720 
00721 /*     End of ZDRVPP */
00722 
00723 } /* zdrvpp_ */


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