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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:40