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


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