cdrvgb.c
Go to the documentation of this file.
00001 /* cdrvgb.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_b48 = {0.f,0.f};
00038 static complex c_b49 = {1.f,0.f};
00039 static integer c__6 = 6;
00040 static integer c__7 = 7;
00041 
00042 /* Subroutine */ int cdrvgb_(logical *dotype, integer *nn, integer *nval, 
00043         integer *nrhs, real *thresh, logical *tsterr, complex *a, integer *la, 
00044          complex *afb, integer *lafb, complex *asav, complex *b, complex *
00045         bsav, complex *x, complex *xact, real *s, complex *work, real *rwork, 
00046         integer *iwork, integer *nout)
00047 {
00048     /* Initialized data */
00049 
00050     static integer iseedy[4] = { 1988,1989,1990,1991 };
00051     static char transs[1*3] = "N" "T" "C";
00052     static char facts[1*3] = "F" "N" "E";
00053     static char equeds[1*4] = "N" "R" "C" "B";
00054 
00055     /* Format strings */
00056     static char fmt_9999[] = "(\002 *** In CDRVGB, LA=\002,i5,\002 is too sm"
00057             "all for N=\002,i5,\002, KU=\002,i5,\002, KL=\002,i5,/\002 ==> In"
00058             "crease LA to at least \002,i5)";
00059     static char fmt_9998[] = "(\002 *** In CDRVGB, LAFB=\002,i5,\002 is too "
00060             "small for N=\002,i5,\002, KU=\002,i5,\002, KL=\002,i5,/\002 ==> "
00061             "Increase LAFB to at least \002,i5)";
00062     static char fmt_9997[] = "(1x,a,\002, N=\002,i5,\002, KL=\002,i5,\002, K"
00063             "U=\002,i5,\002, type \002,i1,\002, test(\002,i1,\002)=\002,g12.5)"
00064             ;
00065     static char fmt_9995[] = "(1x,a,\002( '\002,a1,\002','\002,a1,\002',\002"
00066             ",i5,\002,\002,i5,\002,\002,i5,\002,...), EQUED='\002,a1,\002', t"
00067             "ype \002,i1,\002, test(\002,i1,\002)=\002,g12.5)";
00068     static char fmt_9996[] = "(1x,a,\002( '\002,a1,\002','\002,a1,\002',\002"
00069             ",i5,\002,\002,i5,\002,\002,i5,\002,...), type \002,i1,\002, test("
00070             "\002,i1,\002)=\002,g12.5)";
00071 
00072     /* System generated locals */
00073     address a__1[2];
00074     integer i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8, i__9, i__10, 
00075             i__11[2];
00076     real r__1, r__2;
00077     char ch__1[2];
00078 
00079     /* Builtin functions */
00080     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
00081     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00082     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
00083     double c_abs(complex *);
00084 
00085     /* Local variables */
00086     integer i__, j, k, n, i1, i2, k1, nb, in, kl, ku, nt, lda, ldb, ikl, nkl, 
00087             iku, nku;
00088     char fact[1];
00089     integer ioff, mode;
00090     real amax;
00091     char path[3];
00092     integer imat, info;
00093     char dist[1];
00094     real rdum[1];
00095     char type__[1];
00096     integer nrun, ldafb;
00097     extern /* Subroutine */ int cgbt01_(integer *, integer *, integer *, 
00098             integer *, complex *, integer *, complex *, integer *, integer *, 
00099             complex *, real *), cgbt02_(char *, integer *, integer *, integer 
00100             *, integer *, integer *, complex *, integer *, complex *, integer 
00101             *, complex *, integer *, real *), cgbt05_(char *, integer 
00102             *, integer *, integer *, integer *, complex *, integer *, complex 
00103             *, integer *, complex *, integer *, complex *, integer *, real *, 
00104             real *, real *);
00105     integer ifact;
00106     extern /* Subroutine */ int cget04_(integer *, integer *, complex *, 
00107             integer *, complex *, integer *, real *, real *);
00108     integer nfail, iseed[4], nfact;
00109     extern logical lsame_(char *, char *);
00110     char equed[1];
00111     integer nbmin;
00112     real rcond, roldc;
00113     extern /* Subroutine */ int cgbsv_(integer *, integer *, integer *, 
00114             integer *, complex *, integer *, integer *, complex *, integer *, 
00115             integer *);
00116     integer nimat;
00117     real roldi;
00118     extern doublereal sget06_(real *, real *);
00119     real anorm;
00120     integer itran;
00121     logical equil;
00122     real roldo;
00123     char trans[1];
00124     integer izero, nerrs;
00125     logical zerot;
00126     char xtype[1];
00127     extern /* Subroutine */ int clatb4_(char *, integer *, integer *, integer 
00128             *, char *, integer *, integer *, real *, integer *, real *, char *
00129 ), aladhd_(integer *, char *);
00130     extern doublereal clangb_(char *, integer *, integer *, integer *, 
00131             complex *, integer *, real *), clange_(char *, integer *, 
00132             integer *, complex *, integer *, real *);
00133     extern /* Subroutine */ int claqgb_(integer *, integer *, integer *, 
00134             integer *, complex *, integer *, real *, real *, real *, real *, 
00135             real *, char *), alaerh_(char *, char *, integer *, 
00136             integer *, char *, integer *, integer *, integer *, integer *, 
00137             integer *, integer *, integer *, integer *, integer *);
00138     logical prefac;
00139     real colcnd;
00140     extern doublereal clantb_(char *, char *, char *, integer *, integer *, 
00141             complex *, integer *, real *);
00142     extern /* Subroutine */ int cgbequ_(integer *, integer *, integer *, 
00143             integer *, complex *, integer *, real *, real *, real *, real *, 
00144             real *, integer *);
00145     real rcondc;
00146     extern doublereal slamch_(char *);
00147     logical nofact;
00148     extern /* Subroutine */ int cgbtrf_(integer *, integer *, integer *, 
00149             integer *, complex *, integer *, integer *, integer *);
00150     integer iequed;
00151     extern /* Subroutine */ int clacpy_(char *, integer *, integer *, complex 
00152             *, integer *, complex *, integer *);
00153     real rcondi;
00154     extern /* Subroutine */ int clarhs_(char *, char *, char *, char *, 
00155             integer *, integer *, integer *, integer *, integer *, complex *, 
00156             integer *, complex *, integer *, complex *, integer *, integer *, 
00157             integer *), claset_(char *, 
00158             integer *, integer *, complex *, complex *, complex *, integer *), alasvm_(char *, integer *, integer *, integer *, integer 
00159             *);
00160     real cndnum, anormi, rcondo, ainvnm;
00161     extern /* Subroutine */ int cgbtrs_(char *, integer *, integer *, integer 
00162             *, integer *, complex *, integer *, integer *, complex *, integer 
00163             *, integer *), clatms_(integer *, integer *, char *, 
00164             integer *, char *, real *, integer *, real *, real *, integer *, 
00165             integer *, char *, complex *, integer *, complex *, integer *);
00166     logical trfcon;
00167     real anormo, rowcnd;
00168     extern /* Subroutine */ int cgbsvx_(char *, char *, integer *, integer *, 
00169             integer *, integer *, complex *, integer *, complex *, integer *, 
00170             integer *, char *, real *, real *, complex *, integer *, complex *
00171 , integer *, real *, real *, real *, complex *, real *, integer *), xlaenv_(integer *, integer *);
00172     real anrmpv;
00173     extern /* Subroutine */ int cerrvx_(char *, integer *);
00174     real result[7], rpvgrw;
00175 
00176     /* Fortran I/O blocks */
00177     static cilist io___26 = { 0, 0, 0, fmt_9999, 0 };
00178     static cilist io___27 = { 0, 0, 0, fmt_9998, 0 };
00179     static cilist io___65 = { 0, 0, 0, fmt_9997, 0 };
00180     static cilist io___73 = { 0, 0, 0, fmt_9995, 0 };
00181     static cilist io___74 = { 0, 0, 0, fmt_9996, 0 };
00182     static cilist io___75 = { 0, 0, 0, fmt_9995, 0 };
00183     static cilist io___76 = { 0, 0, 0, fmt_9996, 0 };
00184     static cilist io___77 = { 0, 0, 0, fmt_9995, 0 };
00185     static cilist io___78 = { 0, 0, 0, fmt_9996, 0 };
00186     static cilist io___79 = { 0, 0, 0, fmt_9995, 0 };
00187     static cilist io___80 = { 0, 0, 0, fmt_9996, 0 };
00188 
00189 
00190 
00191 /*  -- LAPACK test routine (version 3.1) -- */
00192 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00193 /*     November 2006 */
00194 
00195 /*     .. Scalar Arguments .. */
00196 /*     .. */
00197 /*     .. Array Arguments .. */
00198 /*     .. */
00199 
00200 /*  Purpose */
00201 /*  ======= */
00202 
00203 /*  CDRVGB tests the driver routines CGBSV and -SVX. */
00204 
00205 /*  Arguments */
00206 /*  ========= */
00207 
00208 /*  DOTYPE  (input) LOGICAL array, dimension (NTYPES) */
00209 /*          The matrix types to be used for testing.  Matrices of type j */
00210 /*          (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) = */
00211 /*          .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used. */
00212 
00213 /*  NN      (input) INTEGER */
00214 /*          The number of values of N contained in the vector NVAL. */
00215 
00216 /*  NVAL    (input) INTEGER array, dimension (NN) */
00217 /*          The values of the matrix column dimension N. */
00218 
00219 /*  NRHS    (input) INTEGER */
00220 /*          The number of right hand side vectors to be generated for */
00221 /*          each linear system. */
00222 
00223 /*  THRESH  (input) REAL */
00224 /*          The threshold value for the test ratios.  A result is */
00225 /*          included in the output file if RESULT >= THRESH.  To have */
00226 /*          every test ratio printed, use THRESH = 0. */
00227 
00228 /*  TSTERR  (input) LOGICAL */
00229 /*          Flag that indicates whether error exits are to be tested. */
00230 
00231 /*  A       (workspace) COMPLEX array, dimension (LA) */
00232 
00233 /*  LA      (input) INTEGER */
00234 /*          The length of the array A.  LA >= (2*NMAX-1)*NMAX */
00235 /*          where NMAX is the largest entry in NVAL. */
00236 
00237 /*  AFB     (workspace) COMPLEX array, dimension (LAFB) */
00238 
00239 /*  LAFB    (input) INTEGER */
00240 /*          The length of the array AFB.  LAFB >= (3*NMAX-2)*NMAX */
00241 /*          where NMAX is the largest entry in NVAL. */
00242 
00243 /*  ASAV    (workspace) COMPLEX array, dimension (LA) */
00244 
00245 /*  B       (workspace) COMPLEX array, dimension (NMAX*NRHS) */
00246 
00247 /*  BSAV    (workspace) COMPLEX array, dimension (NMAX*NRHS) */
00248 
00249 /*  X       (workspace) COMPLEX array, dimension (NMAX*NRHS) */
00250 
00251 /*  XACT    (workspace) COMPLEX array, dimension (NMAX*NRHS) */
00252 
00253 /*  S       (workspace) REAL array, dimension (2*NMAX) */
00254 
00255 /*  WORK    (workspace) COMPLEX array, dimension */
00256 /*                      (NMAX*max(3,NRHS,NMAX)) */
00257 
00258 /*  RWORK   (workspace) REAL array, dimension */
00259 /*                      (max(NMAX,2*NRHS)) */
00260 
00261 /*  IWORK   (workspace) INTEGER array, dimension (NMAX) */
00262 
00263 /*  NOUT    (input) INTEGER */
00264 /*          The unit number for output. */
00265 
00266 /*  ===================================================================== */
00267 
00268 /*     .. Parameters .. */
00269 /*     .. */
00270 /*     .. Local Scalars .. */
00271 /*     .. */
00272 /*     .. Local Arrays .. */
00273 /*     .. */
00274 /*     .. External Functions .. */
00275 /*     .. */
00276 /*     .. External Subroutines .. */
00277 /*     .. */
00278 /*     .. Intrinsic Functions .. */
00279 /*     .. */
00280 /*     .. Scalars in Common .. */
00281 /*     .. */
00282 /*     .. Common blocks .. */
00283 /*     .. */
00284 /*     .. Data statements .. */
00285     /* Parameter adjustments */
00286     --iwork;
00287     --rwork;
00288     --work;
00289     --s;
00290     --xact;
00291     --x;
00292     --bsav;
00293     --b;
00294     --asav;
00295     --afb;
00296     --a;
00297     --nval;
00298     --dotype;
00299 
00300     /* Function Body */
00301 /*     .. */
00302 /*     .. Executable Statements .. */
00303 
00304 /*     Initialize constants and the random number seed. */
00305 
00306     s_copy(path, "Complex precision", (ftnlen)1, (ftnlen)17);
00307     s_copy(path + 1, "GB", (ftnlen)2, (ftnlen)2);
00308     nrun = 0;
00309     nfail = 0;
00310     nerrs = 0;
00311     for (i__ = 1; i__ <= 4; ++i__) {
00312         iseed[i__ - 1] = iseedy[i__ - 1];
00313 /* L10: */
00314     }
00315 
00316 /*     Test the error exits */
00317 
00318     if (*tsterr) {
00319         cerrvx_(path, nout);
00320     }
00321     infoc_1.infot = 0;
00322 
00323 /*     Set the block size and minimum block size for testing. */
00324 
00325     nb = 1;
00326     nbmin = 2;
00327     xlaenv_(&c__1, &nb);
00328     xlaenv_(&c__2, &nbmin);
00329 
00330 /*     Do for each value of N in NVAL */
00331 
00332     i__1 = *nn;
00333     for (in = 1; in <= i__1; ++in) {
00334         n = nval[in];
00335         ldb = max(n,1);
00336         *(unsigned char *)xtype = 'N';
00337 
00338 /*        Set limits on the number of loop iterations. */
00339 
00340 /* Computing MAX */
00341         i__2 = 1, i__3 = min(n,4);
00342         nkl = max(i__2,i__3);
00343         if (n == 0) {
00344             nkl = 1;
00345         }
00346         nku = nkl;
00347         nimat = 8;
00348         if (n <= 0) {
00349             nimat = 1;
00350         }
00351 
00352         i__2 = nkl;
00353         for (ikl = 1; ikl <= i__2; ++ikl) {
00354 
00355 /*           Do for KL = 0, N-1, (3N-1)/4, and (N+1)/4. This order makes */
00356 /*           it easier to skip redundant values for small values of N. */
00357 
00358             if (ikl == 1) {
00359                 kl = 0;
00360             } else if (ikl == 2) {
00361 /* Computing MAX */
00362                 i__3 = n - 1;
00363                 kl = max(i__3,0);
00364             } else if (ikl == 3) {
00365                 kl = (n * 3 - 1) / 4;
00366             } else if (ikl == 4) {
00367                 kl = (n + 1) / 4;
00368             }
00369             i__3 = nku;
00370             for (iku = 1; iku <= i__3; ++iku) {
00371 
00372 /*              Do for KU = 0, N-1, (3N-1)/4, and (N+1)/4. This order */
00373 /*              makes it easier to skip redundant values for small */
00374 /*              values of N. */
00375 
00376                 if (iku == 1) {
00377                     ku = 0;
00378                 } else if (iku == 2) {
00379 /* Computing MAX */
00380                     i__4 = n - 1;
00381                     ku = max(i__4,0);
00382                 } else if (iku == 3) {
00383                     ku = (n * 3 - 1) / 4;
00384                 } else if (iku == 4) {
00385                     ku = (n + 1) / 4;
00386                 }
00387 
00388 /*              Check that A and AFB are big enough to generate this */
00389 /*              matrix. */
00390 
00391                 lda = kl + ku + 1;
00392                 ldafb = (kl << 1) + ku + 1;
00393                 if (lda * n > *la || ldafb * n > *lafb) {
00394                     if (nfail == 0 && nerrs == 0) {
00395                         aladhd_(nout, path);
00396                     }
00397                     if (lda * n > *la) {
00398                         io___26.ciunit = *nout;
00399                         s_wsfe(&io___26);
00400                         do_fio(&c__1, (char *)&(*la), (ftnlen)sizeof(integer))
00401                                 ;
00402                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00403                         do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00404                         do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00405                         i__4 = n * (kl + ku + 1);
00406                         do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer));
00407                         e_wsfe();
00408                         ++nerrs;
00409                     }
00410                     if (ldafb * n > *lafb) {
00411                         io___27.ciunit = *nout;
00412                         s_wsfe(&io___27);
00413                         do_fio(&c__1, (char *)&(*lafb), (ftnlen)sizeof(
00414                                 integer));
00415                         do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00416                         do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00417                         do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00418                         i__4 = n * ((kl << 1) + ku + 1);
00419                         do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer));
00420                         e_wsfe();
00421                         ++nerrs;
00422                     }
00423                     goto L130;
00424                 }
00425 
00426                 i__4 = nimat;
00427                 for (imat = 1; imat <= i__4; ++imat) {
00428 
00429 /*                 Do the tests only if DOTYPE( IMAT ) is true. */
00430 
00431                     if (! dotype[imat]) {
00432                         goto L120;
00433                     }
00434 
00435 /*                 Skip types 2, 3, or 4 if the matrix is too small. */
00436 
00437                     zerot = imat >= 2 && imat <= 4;
00438                     if (zerot && n < imat - 1) {
00439                         goto L120;
00440                     }
00441 
00442 /*                 Set up parameters with CLATB4 and generate a */
00443 /*                 test matrix with CLATMS. */
00444 
00445                     clatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &
00446                             mode, &cndnum, dist);
00447                     rcondc = 1.f / cndnum;
00448 
00449                     s_copy(srnamc_1.srnamt, "CLATMS", (ftnlen)32, (ftnlen)6);
00450                     clatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00451                             cndnum, &anorm, &kl, &ku, "Z", &a[1], &lda, &work[
00452                             1], &info);
00453 
00454 /*                 Check the error code from CLATMS. */
00455 
00456                     if (info != 0) {
00457                         alaerh_(path, "CLATMS", &info, &c__0, " ", &n, &n, &
00458                                 kl, &ku, &c_n1, &imat, &nfail, &nerrs, nout);
00459                         goto L120;
00460                     }
00461 
00462 /*                 For types 2, 3, and 4, zero one or more columns of */
00463 /*                 the matrix to test that INFO is returned correctly. */
00464 
00465                     izero = 0;
00466                     if (zerot) {
00467                         if (imat == 2) {
00468                             izero = 1;
00469                         } else if (imat == 3) {
00470                             izero = n;
00471                         } else {
00472                             izero = n / 2 + 1;
00473                         }
00474                         ioff = (izero - 1) * lda;
00475                         if (imat < 4) {
00476 /* Computing MAX */
00477                             i__5 = 1, i__6 = ku + 2 - izero;
00478                             i1 = max(i__5,i__6);
00479 /* Computing MIN */
00480                             i__5 = kl + ku + 1, i__6 = ku + 1 + (n - izero);
00481                             i2 = min(i__5,i__6);
00482                             i__5 = i2;
00483                             for (i__ = i1; i__ <= i__5; ++i__) {
00484                                 i__6 = ioff + i__;
00485                                 a[i__6].r = 0.f, a[i__6].i = 0.f;
00486 /* L20: */
00487                             }
00488                         } else {
00489                             i__5 = n;
00490                             for (j = izero; j <= i__5; ++j) {
00491 /* Computing MAX */
00492                                 i__6 = 1, i__7 = ku + 2 - j;
00493 /* Computing MIN */
00494                                 i__9 = kl + ku + 1, i__10 = ku + 1 + (n - j);
00495                                 i__8 = min(i__9,i__10);
00496                                 for (i__ = max(i__6,i__7); i__ <= i__8; ++i__)
00497                                          {
00498                                     i__6 = ioff + i__;
00499                                     a[i__6].r = 0.f, a[i__6].i = 0.f;
00500 /* L30: */
00501                                 }
00502                                 ioff += lda;
00503 /* L40: */
00504                             }
00505                         }
00506                     }
00507 
00508 /*                 Save a copy of the matrix A in ASAV. */
00509 
00510                     i__5 = kl + ku + 1;
00511                     clacpy_("Full", &i__5, &n, &a[1], &lda, &asav[1], &lda);
00512 
00513                     for (iequed = 1; iequed <= 4; ++iequed) {
00514                         *(unsigned char *)equed = *(unsigned char *)&equeds[
00515                                 iequed - 1];
00516                         if (iequed == 1) {
00517                             nfact = 3;
00518                         } else {
00519                             nfact = 1;
00520                         }
00521 
00522                         i__5 = nfact;
00523                         for (ifact = 1; ifact <= i__5; ++ifact) {
00524                             *(unsigned char *)fact = *(unsigned char *)&facts[
00525                                     ifact - 1];
00526                             prefac = lsame_(fact, "F");
00527                             nofact = lsame_(fact, "N");
00528                             equil = lsame_(fact, "E");
00529 
00530                             if (zerot) {
00531                                 if (prefac) {
00532                                     goto L100;
00533                                 }
00534                                 rcondo = 0.f;
00535                                 rcondi = 0.f;
00536 
00537                             } else if (! nofact) {
00538 
00539 /*                          Compute the condition number for comparison */
00540 /*                          with the value returned by SGESVX (FACT = */
00541 /*                          'N' reuses the condition number from the */
00542 /*                          previous iteration with FACT = 'F'). */
00543 
00544                                 i__8 = kl + ku + 1;
00545                                 clacpy_("Full", &i__8, &n, &asav[1], &lda, &
00546                                         afb[kl + 1], &ldafb);
00547                                 if (equil || iequed > 1) {
00548 
00549 /*                             Compute row and column scale factors to */
00550 /*                             equilibrate the matrix A. */
00551 
00552                                     cgbequ_(&n, &n, &kl, &ku, &afb[kl + 1], &
00553                                             ldafb, &s[1], &s[n + 1], &rowcnd, 
00554                                             &colcnd, &amax, &info);
00555                                     if (info == 0 && n > 0) {
00556                                         if (lsame_(equed, "R")) {
00557                                             rowcnd = 0.f;
00558                                             colcnd = 1.f;
00559                                         } else if (lsame_(equed, "C")) {
00560                                             rowcnd = 1.f;
00561                                             colcnd = 0.f;
00562                                         } else if (lsame_(equed, "B")) {
00563                                             rowcnd = 0.f;
00564                                             colcnd = 0.f;
00565                                         }
00566 
00567 /*                                Equilibrate the matrix. */
00568 
00569                                         claqgb_(&n, &n, &kl, &ku, &afb[kl + 1]
00570 , &ldafb, &s[1], &s[n + 1], &
00571                                                 rowcnd, &colcnd, &amax, equed);
00572                                     }
00573                                 }
00574 
00575 /*                          Save the condition number of the */
00576 /*                          non-equilibrated system for use in CGET04. */
00577 
00578                                 if (equil) {
00579                                     roldo = rcondo;
00580                                     roldi = rcondi;
00581                                 }
00582 
00583 /*                          Compute the 1-norm and infinity-norm of A. */
00584 
00585                                 anormo = clangb_("1", &n, &kl, &ku, &afb[kl + 
00586                                         1], &ldafb, &rwork[1]);
00587                                 anormi = clangb_("I", &n, &kl, &ku, &afb[kl + 
00588                                         1], &ldafb, &rwork[1]);
00589 
00590 /*                          Factor the matrix A. */
00591 
00592                                 cgbtrf_(&n, &n, &kl, &ku, &afb[1], &ldafb, &
00593                                         iwork[1], &info);
00594 
00595 /*                          Form the inverse of A. */
00596 
00597                                 claset_("Full", &n, &n, &c_b48, &c_b49, &work[
00598                                         1], &ldb);
00599                                 s_copy(srnamc_1.srnamt, "CGBTRS", (ftnlen)32, 
00600                                         (ftnlen)6);
00601                                 cgbtrs_("No transpose", &n, &kl, &ku, &n, &
00602                                         afb[1], &ldafb, &iwork[1], &work[1], &
00603                                         ldb, &info);
00604 
00605 /*                          Compute the 1-norm condition number of A. */
00606 
00607                                 ainvnm = clange_("1", &n, &n, &work[1], &ldb, 
00608                                         &rwork[1]);
00609                                 if (anormo <= 0.f || ainvnm <= 0.f) {
00610                                     rcondo = 1.f;
00611                                 } else {
00612                                     rcondo = 1.f / anormo / ainvnm;
00613                                 }
00614 
00615 /*                          Compute the infinity-norm condition number */
00616 /*                          of A. */
00617 
00618                                 ainvnm = clange_("I", &n, &n, &work[1], &ldb, 
00619                                         &rwork[1]);
00620                                 if (anormi <= 0.f || ainvnm <= 0.f) {
00621                                     rcondi = 1.f;
00622                                 } else {
00623                                     rcondi = 1.f / anormi / ainvnm;
00624                                 }
00625                             }
00626 
00627                             for (itran = 1; itran <= 3; ++itran) {
00628 
00629 /*                          Do for each value of TRANS. */
00630 
00631                                 *(unsigned char *)trans = *(unsigned char *)&
00632                                         transs[itran - 1];
00633                                 if (itran == 1) {
00634                                     rcondc = rcondo;
00635                                 } else {
00636                                     rcondc = rcondi;
00637                                 }
00638 
00639 /*                          Restore the matrix A. */
00640 
00641                                 i__8 = kl + ku + 1;
00642                                 clacpy_("Full", &i__8, &n, &asav[1], &lda, &a[
00643                                         1], &lda);
00644 
00645 /*                          Form an exact solution and set the right hand */
00646 /*                          side. */
00647 
00648                                 s_copy(srnamc_1.srnamt, "CLARHS", (ftnlen)32, 
00649                                         (ftnlen)6);
00650                                 clarhs_(path, xtype, "Full", trans, &n, &n, &
00651                                         kl, &ku, nrhs, &a[1], &lda, &xact[1], 
00652                                         &ldb, &b[1], &ldb, iseed, &info);
00653                                 *(unsigned char *)xtype = 'C';
00654                                 clacpy_("Full", &n, nrhs, &b[1], &ldb, &bsav[
00655                                         1], &ldb);
00656 
00657                                 if (nofact && itran == 1) {
00658 
00659 /*                             --- Test CGBSV  --- */
00660 
00661 /*                             Compute the LU factorization of the matrix */
00662 /*                             and solve the system. */
00663 
00664                                     i__8 = kl + ku + 1;
00665                                     clacpy_("Full", &i__8, &n, &a[1], &lda, &
00666                                             afb[kl + 1], &ldafb);
00667                                     clacpy_("Full", &n, nrhs, &b[1], &ldb, &x[
00668                                             1], &ldb);
00669 
00670                                     s_copy(srnamc_1.srnamt, "CGBSV ", (ftnlen)
00671                                             32, (ftnlen)6);
00672                                     cgbsv_(&n, &kl, &ku, nrhs, &afb[1], &
00673                                             ldafb, &iwork[1], &x[1], &ldb, &
00674                                             info);
00675 
00676 /*                             Check error code from CGBSV . */
00677 
00678                                     if (info != izero) {
00679                                         alaerh_(path, "CGBSV ", &info, &izero, 
00680                                                  " ", &n, &n, &kl, &ku, nrhs, 
00681                                                 &imat, &nfail, &nerrs, nout);
00682                                     }
00683 
00684 /*                             Reconstruct matrix from factors and */
00685 /*                             compute residual. */
00686 
00687                                     cgbt01_(&n, &n, &kl, &ku, &a[1], &lda, &
00688                                             afb[1], &ldafb, &iwork[1], &work[
00689                                             1], result);
00690                                     nt = 1;
00691                                     if (izero == 0) {
00692 
00693 /*                                Compute residual of the computed */
00694 /*                                solution. */
00695 
00696                                         clacpy_("Full", &n, nrhs, &b[1], &ldb, 
00697                                                  &work[1], &ldb);
00698                                         cgbt02_("No transpose", &n, &n, &kl, &
00699                                                 ku, nrhs, &a[1], &lda, &x[1], 
00700                                                 &ldb, &work[1], &ldb, &result[
00701                                                 1]);
00702 
00703 /*                                Check solution from generated exact */
00704 /*                                solution. */
00705 
00706                                         cget04_(&n, nrhs, &x[1], &ldb, &xact[
00707                                                 1], &ldb, &rcondc, &result[2])
00708                                                 ;
00709                                         nt = 3;
00710                                     }
00711 
00712 /*                             Print information about the tests that did */
00713 /*                             not pass the threshold. */
00714 
00715                                     i__8 = nt;
00716                                     for (k = 1; k <= i__8; ++k) {
00717                                         if (result[k - 1] >= *thresh) {
00718                                             if (nfail == 0 && nerrs == 0) {
00719                           aladhd_(nout, path);
00720                                             }
00721                                             io___65.ciunit = *nout;
00722                                             s_wsfe(&io___65);
00723                                             do_fio(&c__1, "CGBSV ", (ftnlen)6)
00724                                                     ;
00725                                             do_fio(&c__1, (char *)&n, (ftnlen)
00726                                                     sizeof(integer));
00727                                             do_fio(&c__1, (char *)&kl, (
00728                                                     ftnlen)sizeof(integer));
00729                                             do_fio(&c__1, (char *)&ku, (
00730                                                     ftnlen)sizeof(integer));
00731                                             do_fio(&c__1, (char *)&imat, (
00732                                                     ftnlen)sizeof(integer));
00733                                             do_fio(&c__1, (char *)&k, (ftnlen)
00734                                                     sizeof(integer));
00735                                             do_fio(&c__1, (char *)&result[k - 
00736                                                     1], (ftnlen)sizeof(real));
00737                                             e_wsfe();
00738                                             ++nfail;
00739                                         }
00740 /* L50: */
00741                                     }
00742                                     nrun += nt;
00743                                 }
00744 
00745 /*                          --- Test CGBSVX --- */
00746 
00747                                 if (! prefac) {
00748                                     i__8 = (kl << 1) + ku + 1;
00749                                     claset_("Full", &i__8, &n, &c_b48, &c_b48, 
00750                                              &afb[1], &ldafb);
00751                                 }
00752                                 claset_("Full", &n, nrhs, &c_b48, &c_b48, &x[
00753                                         1], &ldb);
00754                                 if (iequed > 1 && n > 0) {
00755 
00756 /*                             Equilibrate the matrix if FACT = 'F' and */
00757 /*                             EQUED = 'R', 'C', or 'B'. */
00758 
00759                                     claqgb_(&n, &n, &kl, &ku, &a[1], &lda, &s[
00760                                             1], &s[n + 1], &rowcnd, &colcnd, &
00761                                             amax, equed);
00762                                 }
00763 
00764 /*                          Solve the system and compute the condition */
00765 /*                          number and error bounds using CGBSVX. */
00766 
00767                                 s_copy(srnamc_1.srnamt, "CGBSVX", (ftnlen)32, 
00768                                         (ftnlen)6);
00769                                 cgbsvx_(fact, trans, &n, &kl, &ku, nrhs, &a[1]
00770 , &lda, &afb[1], &ldafb, &iwork[1], 
00771                                         equed, &s[1], &s[ldb + 1], &b[1], &
00772                                         ldb, &x[1], &ldb, &rcond, &rwork[1], &
00773                                         rwork[*nrhs + 1], &work[1], &rwork[(*
00774                                         nrhs << 1) + 1], &info);
00775 
00776 /*                          Check the error code from CGBSVX. */
00777 
00778                                 if (info != izero) {
00779 /* Writing concatenation */
00780                                     i__11[0] = 1, a__1[0] = fact;
00781                                     i__11[1] = 1, a__1[1] = trans;
00782                                     s_cat(ch__1, a__1, i__11, &c__2, (ftnlen)
00783                                             2);
00784                                     alaerh_(path, "CGBSVX", &info, &izero, 
00785                                             ch__1, &n, &n, &kl, &ku, nrhs, &
00786                                             imat, &nfail, &nerrs, nout);
00787                                 }
00788 /*                          Compare RWORK(2*NRHS+1) from CGBSVX with the */
00789 /*                          computed reciprocal pivot growth RPVGRW */
00790 
00791                                 if (info != 0) {
00792                                     anrmpv = 0.f;
00793                                     i__8 = info;
00794                                     for (j = 1; j <= i__8; ++j) {
00795 /* Computing MAX */
00796                                         i__6 = ku + 2 - j;
00797 /* Computing MIN */
00798                                         i__9 = n + ku + 1 - j, i__10 = kl + 
00799                                                 ku + 1;
00800                                         i__7 = min(i__9,i__10);
00801                                         for (i__ = max(i__6,1); i__ <= i__7; 
00802                                                 ++i__) {
00803 /* Computing MAX */
00804                                             r__1 = anrmpv, r__2 = c_abs(&a[
00805                                                     i__ + (j - 1) * lda]);
00806                                             anrmpv = dmax(r__1,r__2);
00807 /* L60: */
00808                                         }
00809 /* L70: */
00810                                     }
00811 /* Computing MIN */
00812                                     i__7 = info - 1, i__6 = kl + ku;
00813                                     i__8 = min(i__7,i__6);
00814 /* Computing MAX */
00815                                     i__9 = 1, i__10 = kl + ku + 2 - info;
00816                                     rpvgrw = clantb_("M", "U", "N", &info, &
00817                                             i__8, &afb[max(i__9, i__10)], &
00818                                             ldafb, rdum);
00819                                     if (rpvgrw == 0.f) {
00820                                         rpvgrw = 1.f;
00821                                     } else {
00822                                         rpvgrw = anrmpv / rpvgrw;
00823                                     }
00824                                 } else {
00825                                     i__8 = kl + ku;
00826                                     rpvgrw = clantb_("M", "U", "N", &n, &i__8, 
00827                                              &afb[1], &ldafb, rdum);
00828                                     if (rpvgrw == 0.f) {
00829                                         rpvgrw = 1.f;
00830                                     } else {
00831                                         rpvgrw = clangb_("M", &n, &kl, &ku, &
00832                                                 a[1], &lda, rdum) /
00833                                                  rpvgrw;
00834                                     }
00835                                 }
00836 /* Computing MAX */
00837                                 r__2 = rwork[(*nrhs << 1) + 1];
00838                                 result[6] = (r__1 = rpvgrw - rwork[(*nrhs << 
00839                                         1) + 1], dabs(r__1)) / dmax(r__2,
00840                                         rpvgrw) / slamch_("E");
00841 
00842                                 if (! prefac) {
00843 
00844 /*                             Reconstruct matrix from factors and */
00845 /*                             compute residual. */
00846 
00847                                     cgbt01_(&n, &n, &kl, &ku, &a[1], &lda, &
00848                                             afb[1], &ldafb, &iwork[1], &work[
00849                                             1], result);
00850                                     k1 = 1;
00851                                 } else {
00852                                     k1 = 2;
00853                                 }
00854 
00855                                 if (info == 0) {
00856                                     trfcon = FALSE_;
00857 
00858 /*                             Compute residual of the computed solution. */
00859 
00860                                     clacpy_("Full", &n, nrhs, &bsav[1], &ldb, 
00861                                             &work[1], &ldb);
00862                                     cgbt02_(trans, &n, &n, &kl, &ku, nrhs, &
00863                                             asav[1], &lda, &x[1], &ldb, &work[
00864                                             1], &ldb, &result[1]);
00865 
00866 /*                             Check solution from generated exact */
00867 /*                             solution. */
00868 
00869                                     if (nofact || prefac && lsame_(equed, 
00870                                             "N")) {
00871                                         cget04_(&n, nrhs, &x[1], &ldb, &xact[
00872                                                 1], &ldb, &rcondc, &result[2])
00873                                                 ;
00874                                     } else {
00875                                         if (itran == 1) {
00876                                             roldc = roldo;
00877                                         } else {
00878                                             roldc = roldi;
00879                                         }
00880                                         cget04_(&n, nrhs, &x[1], &ldb, &xact[
00881                                                 1], &ldb, &roldc, &result[2]);
00882                                     }
00883 
00884 /*                             Check the error bounds from iterative */
00885 /*                             refinement. */
00886 
00887                                     cgbt05_(trans, &n, &kl, &ku, nrhs, &asav[
00888                                             1], &lda, &bsav[1], &ldb, &x[1], &
00889                                             ldb, &xact[1], &ldb, &rwork[1], &
00890                                             rwork[*nrhs + 1], &result[3]);
00891                                 } else {
00892                                     trfcon = TRUE_;
00893                                 }
00894 
00895 /*                          Compare RCOND from CGBSVX with the computed */
00896 /*                          value in RCONDC. */
00897 
00898                                 result[5] = sget06_(&rcond, &rcondc);
00899 
00900 /*                          Print information about the tests that did */
00901 /*                          not pass the threshold. */
00902 
00903                                 if (! trfcon) {
00904                                     for (k = k1; k <= 7; ++k) {
00905                                         if (result[k - 1] >= *thresh) {
00906                                             if (nfail == 0 && nerrs == 0) {
00907                           aladhd_(nout, path);
00908                                             }
00909                                             if (prefac) {
00910                           io___73.ciunit = *nout;
00911                           s_wsfe(&io___73);
00912                           do_fio(&c__1, "CGBSVX", (ftnlen)6);
00913                           do_fio(&c__1, fact, (ftnlen)1);
00914                           do_fio(&c__1, trans, (ftnlen)1);
00915                           do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00916                           do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00917                           do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00918                           do_fio(&c__1, equed, (ftnlen)1);
00919                           do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer)
00920                                   );
00921                           do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
00922                           do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00923                                   sizeof(real));
00924                           e_wsfe();
00925                                             } else {
00926                           io___74.ciunit = *nout;
00927                           s_wsfe(&io___74);
00928                           do_fio(&c__1, "CGBSVX", (ftnlen)6);
00929                           do_fio(&c__1, fact, (ftnlen)1);
00930                           do_fio(&c__1, trans, (ftnlen)1);
00931                           do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00932                           do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00933                           do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00934                           do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer)
00935                                   );
00936                           do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
00937                           do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00938                                   sizeof(real));
00939                           e_wsfe();
00940                                             }
00941                                             ++nfail;
00942                                         }
00943 /* L80: */
00944                                     }
00945                                     nrun = nrun + 7 - k1;
00946                                 } else {
00947                                     if (result[0] >= *thresh && ! prefac) {
00948                                         if (nfail == 0 && nerrs == 0) {
00949                                             aladhd_(nout, path);
00950                                         }
00951                                         if (prefac) {
00952                                             io___75.ciunit = *nout;
00953                                             s_wsfe(&io___75);
00954                                             do_fio(&c__1, "CGBSVX", (ftnlen)6)
00955                                                     ;
00956                                             do_fio(&c__1, fact, (ftnlen)1);
00957                                             do_fio(&c__1, trans, (ftnlen)1);
00958                                             do_fio(&c__1, (char *)&n, (ftnlen)
00959                                                     sizeof(integer));
00960                                             do_fio(&c__1, (char *)&kl, (
00961                                                     ftnlen)sizeof(integer));
00962                                             do_fio(&c__1, (char *)&ku, (
00963                                                     ftnlen)sizeof(integer));
00964                                             do_fio(&c__1, equed, (ftnlen)1);
00965                                             do_fio(&c__1, (char *)&imat, (
00966                                                     ftnlen)sizeof(integer));
00967                                             do_fio(&c__1, (char *)&c__1, (
00968                                                     ftnlen)sizeof(integer));
00969                                             do_fio(&c__1, (char *)&result[0], 
00970                                                     (ftnlen)sizeof(real));
00971                                             e_wsfe();
00972                                         } else {
00973                                             io___76.ciunit = *nout;
00974                                             s_wsfe(&io___76);
00975                                             do_fio(&c__1, "CGBSVX", (ftnlen)6)
00976                                                     ;
00977                                             do_fio(&c__1, fact, (ftnlen)1);
00978                                             do_fio(&c__1, trans, (ftnlen)1);
00979                                             do_fio(&c__1, (char *)&n, (ftnlen)
00980                                                     sizeof(integer));
00981                                             do_fio(&c__1, (char *)&kl, (
00982                                                     ftnlen)sizeof(integer));
00983                                             do_fio(&c__1, (char *)&ku, (
00984                                                     ftnlen)sizeof(integer));
00985                                             do_fio(&c__1, (char *)&imat, (
00986                                                     ftnlen)sizeof(integer));
00987                                             do_fio(&c__1, (char *)&c__1, (
00988                                                     ftnlen)sizeof(integer));
00989                                             do_fio(&c__1, (char *)&result[0], 
00990                                                     (ftnlen)sizeof(real));
00991                                             e_wsfe();
00992                                         }
00993                                         ++nfail;
00994                                         ++nrun;
00995                                     }
00996                                     if (result[5] >= *thresh) {
00997                                         if (nfail == 0 && nerrs == 0) {
00998                                             aladhd_(nout, path);
00999                                         }
01000                                         if (prefac) {
01001                                             io___77.ciunit = *nout;
01002                                             s_wsfe(&io___77);
01003                                             do_fio(&c__1, "CGBSVX", (ftnlen)6)
01004                                                     ;
01005                                             do_fio(&c__1, fact, (ftnlen)1);
01006                                             do_fio(&c__1, trans, (ftnlen)1);
01007                                             do_fio(&c__1, (char *)&n, (ftnlen)
01008                                                     sizeof(integer));
01009                                             do_fio(&c__1, (char *)&kl, (
01010                                                     ftnlen)sizeof(integer));
01011                                             do_fio(&c__1, (char *)&ku, (
01012                                                     ftnlen)sizeof(integer));
01013                                             do_fio(&c__1, equed, (ftnlen)1);
01014                                             do_fio(&c__1, (char *)&imat, (
01015                                                     ftnlen)sizeof(integer));
01016                                             do_fio(&c__1, (char *)&c__6, (
01017                                                     ftnlen)sizeof(integer));
01018                                             do_fio(&c__1, (char *)&result[5], 
01019                                                     (ftnlen)sizeof(real));
01020                                             e_wsfe();
01021                                         } else {
01022                                             io___78.ciunit = *nout;
01023                                             s_wsfe(&io___78);
01024                                             do_fio(&c__1, "CGBSVX", (ftnlen)6)
01025                                                     ;
01026                                             do_fio(&c__1, fact, (ftnlen)1);
01027                                             do_fio(&c__1, trans, (ftnlen)1);
01028                                             do_fio(&c__1, (char *)&n, (ftnlen)
01029                                                     sizeof(integer));
01030                                             do_fio(&c__1, (char *)&kl, (
01031                                                     ftnlen)sizeof(integer));
01032                                             do_fio(&c__1, (char *)&ku, (
01033                                                     ftnlen)sizeof(integer));
01034                                             do_fio(&c__1, (char *)&imat, (
01035                                                     ftnlen)sizeof(integer));
01036                                             do_fio(&c__1, (char *)&c__6, (
01037                                                     ftnlen)sizeof(integer));
01038                                             do_fio(&c__1, (char *)&result[5], 
01039                                                     (ftnlen)sizeof(real));
01040                                             e_wsfe();
01041                                         }
01042                                         ++nfail;
01043                                         ++nrun;
01044                                     }
01045                                     if (result[6] >= *thresh) {
01046                                         if (nfail == 0 && nerrs == 0) {
01047                                             aladhd_(nout, path);
01048                                         }
01049                                         if (prefac) {
01050                                             io___79.ciunit = *nout;
01051                                             s_wsfe(&io___79);
01052                                             do_fio(&c__1, "CGBSVX", (ftnlen)6)
01053                                                     ;
01054                                             do_fio(&c__1, fact, (ftnlen)1);
01055                                             do_fio(&c__1, trans, (ftnlen)1);
01056                                             do_fio(&c__1, (char *)&n, (ftnlen)
01057                                                     sizeof(integer));
01058                                             do_fio(&c__1, (char *)&kl, (
01059                                                     ftnlen)sizeof(integer));
01060                                             do_fio(&c__1, (char *)&ku, (
01061                                                     ftnlen)sizeof(integer));
01062                                             do_fio(&c__1, equed, (ftnlen)1);
01063                                             do_fio(&c__1, (char *)&imat, (
01064                                                     ftnlen)sizeof(integer));
01065                                             do_fio(&c__1, (char *)&c__7, (
01066                                                     ftnlen)sizeof(integer));
01067                                             do_fio(&c__1, (char *)&result[6], 
01068                                                     (ftnlen)sizeof(real));
01069                                             e_wsfe();
01070                                         } else {
01071                                             io___80.ciunit = *nout;
01072                                             s_wsfe(&io___80);
01073                                             do_fio(&c__1, "CGBSVX", (ftnlen)6)
01074                                                     ;
01075                                             do_fio(&c__1, fact, (ftnlen)1);
01076                                             do_fio(&c__1, trans, (ftnlen)1);
01077                                             do_fio(&c__1, (char *)&n, (ftnlen)
01078                                                     sizeof(integer));
01079                                             do_fio(&c__1, (char *)&kl, (
01080                                                     ftnlen)sizeof(integer));
01081                                             do_fio(&c__1, (char *)&ku, (
01082                                                     ftnlen)sizeof(integer));
01083                                             do_fio(&c__1, (char *)&imat, (
01084                                                     ftnlen)sizeof(integer));
01085                                             do_fio(&c__1, (char *)&c__7, (
01086                                                     ftnlen)sizeof(integer));
01087                                             do_fio(&c__1, (char *)&result[6], 
01088                                                     (ftnlen)sizeof(real));
01089                                             e_wsfe();
01090                                         }
01091                                         ++nfail;
01092                                         ++nrun;
01093                                     }
01094                                 }
01095 /* L90: */
01096                             }
01097 L100:
01098                             ;
01099                         }
01100 /* L110: */
01101                     }
01102 L120:
01103                     ;
01104                 }
01105 L130:
01106                 ;
01107             }
01108 /* L140: */
01109         }
01110 /* L150: */
01111     }
01112 
01113 /*     Print a summary of the results. */
01114 
01115     alasvm_(path, nout, &nfail, &nrun, &nerrs);
01116 
01117 
01118     return 0;
01119 
01120 /*     End of CDRVGB */
01121 
01122 } /* cdrvgb_ */


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