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


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