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


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