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


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