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


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