00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
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
00032
00033 static integer c__1 = 1;
00034 static integer c__2 = 2;
00035 static integer c__0 = 0;
00036 static integer c_n1 = -1;
00037 static doublecomplex c_b48 = {0.,0.};
00038 static doublecomplex c_b49 = {1.,0.};
00039 static integer c__6 = 6;
00040 static integer c__7 = 7;
00041
00042 int zdrvgb_(logical *dotype, integer *nn, integer *nval,
00043 integer *nrhs, doublereal *thresh, logical *tsterr, doublecomplex *a,
00044 integer *la, doublecomplex *afb, integer *lafb, doublecomplex *asav,
00045 doublecomplex *b, doublecomplex *bsav, doublecomplex *x,
00046 doublecomplex *xact, doublereal *s, doublecomplex *work, doublereal *
00047 rwork, integer *iwork, integer *nout)
00048 {
00049
00050
00051 static integer iseedy[4] = { 1988,1989,1990,1991 };
00052 static char transs[1*3] = "N" "T" "C";
00053 static char facts[1*3] = "F" "N" "E";
00054 static char equeds[1*4] = "N" "R" "C" "B";
00055
00056
00057 static char fmt_9999[] = "(\002 *** In ZDRVGB, LA=\002,i5,\002 is too sm"
00058 "all for N=\002,i5,\002, KU=\002,i5,\002, KL=\002,i5,/\002 ==> In"
00059 "crease LA to at least \002,i5)";
00060 static char fmt_9998[] = "(\002 *** In ZDRVGB, LAFB=\002,i5,\002 is too "
00061 "small for N=\002,i5,\002, KU=\002,i5,\002, KL=\002,i5,/\002 ==> "
00062 "Increase LAFB to at least \002,i5)";
00063 static char fmt_9997[] = "(1x,a,\002, N=\002,i5,\002, KL=\002,i5,\002, K"
00064 "U=\002,i5,\002, type \002,i1,\002, test(\002,i1,\002)=\002,g12.5)"
00065 ;
00066 static char fmt_9995[] = "(1x,a,\002( '\002,a1,\002','\002,a1,\002',\002"
00067 ",i5,\002,\002,i5,\002,\002,i5,\002,...), EQUED='\002,a1,\002', t"
00068 "ype \002,i1,\002, test(\002,i1,\002)=\002,g12.5)";
00069 static char fmt_9996[] = "(1x,a,\002( '\002,a1,\002','\002,a1,\002',\002"
00070 ",i5,\002,\002,i5,\002,\002,i5,\002,...), type \002,i1,\002, test("
00071 "\002,i1,\002)=\002,g12.5)";
00072
00073
00074 address a__1[2];
00075 integer i__1, i__2, i__3, i__4, i__5, i__6, i__7, i__8, i__9, i__10,
00076 i__11[2];
00077 doublereal d__1, d__2;
00078 char ch__1[2];
00079
00080
00081 int s_copy(char *, char *, ftnlen, ftnlen);
00082 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00083 int s_cat(char *, char **, integer *, integer *, ftnlen);
00084 double z_abs(doublecomplex *);
00085
00086
00087 integer i__, j, k, n, i1, i2, k1, nb, in, kl, ku, nt, lda, ldb, ikl, nkl,
00088 iku, nku;
00089 char fact[1];
00090 integer ioff, mode;
00091 doublereal amax;
00092 char path[3];
00093 integer imat, info;
00094 char dist[1];
00095 doublereal rdum[1];
00096 char type__[1];
00097 integer nrun, ldafb, ifact, nfail, iseed[4], nfact;
00098 extern doublereal dget06_(doublereal *, doublereal *);
00099 extern logical lsame_(char *, char *);
00100 char equed[1];
00101 integer nbmin;
00102 doublereal rcond, roldc;
00103 extern int zgbt01_(integer *, integer *, integer *,
00104 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00105 integer *, doublecomplex *, doublereal *);
00106 integer nimat;
00107 doublereal roldi;
00108 extern int zgbt02_(char *, integer *, integer *, integer
00109 *, integer *, integer *, doublecomplex *, integer *,
00110 doublecomplex *, integer *, doublecomplex *, integer *,
00111 doublereal *), zgbt05_(char *, integer *, integer *,
00112 integer *, integer *, doublecomplex *, integer *, doublecomplex *,
00113 integer *, doublecomplex *, integer *, doublecomplex *, integer *
00114 , doublereal *, doublereal *, doublereal *);
00115 doublereal anorm;
00116 integer itran;
00117 extern int zget04_(integer *, integer *, doublecomplex *,
00118 integer *, doublecomplex *, integer *, doublereal *, doublereal *
00119 );
00120 logical equil;
00121 doublereal roldo;
00122 char trans[1];
00123 integer izero, nerrs;
00124 extern int zgbsv_(integer *, integer *, integer *,
00125 integer *, doublecomplex *, integer *, integer *, doublecomplex *,
00126 integer *, integer *);
00127 logical zerot;
00128 char xtype[1];
00129 extern int zlatb4_(char *, integer *, integer *, integer
00130 *, char *, integer *, integer *, doublereal *, integer *,
00131 doublereal *, char *), aladhd_(integer *,
00132 char *);
00133 extern doublereal dlamch_(char *);
00134 extern int alaerh_(char *, char *, integer *, integer *,
00135 char *, integer *, integer *, integer *, integer *, integer *,
00136 integer *, integer *, integer *, integer *);
00137 logical prefac;
00138 doublereal colcnd, rcondc;
00139 logical nofact;
00140 integer iequed;
00141 extern doublereal zlangb_(char *, integer *, integer *, integer *,
00142 doublecomplex *, integer *, doublereal *);
00143 doublereal rcondi;
00144 extern doublereal zlange_(char *, integer *, integer *, doublecomplex *,
00145 integer *, doublereal *);
00146 extern int zlaqgb_(integer *, integer *, integer *,
00147 integer *, doublecomplex *, integer *, doublereal *, doublereal *,
00148 doublereal *, doublereal *, doublereal *, char *),
00149 alasvm_(char *, integer *, integer *, integer *, integer *);
00150 doublereal cndnum, anormi, rcondo, ainvnm;
00151 extern doublereal zlantb_(char *, char *, char *, integer *, integer *,
00152 doublecomplex *, integer *, doublereal *);
00153 logical trfcon;
00154 doublereal anormo, rowcnd;
00155 extern int xlaenv_(integer *, integer *), zgbequ_(
00156 integer *, integer *, integer *, integer *, doublecomplex *,
00157 integer *, doublereal *, doublereal *, doublereal *, doublereal *,
00158 doublereal *, integer *), zgbtrf_(integer *, integer *, integer *
00159 , integer *, doublecomplex *, integer *, integer *, integer *);
00160 doublereal anrmpv;
00161 extern int zlacpy_(char *, integer *, integer *,
00162 doublecomplex *, integer *, doublecomplex *, integer *),
00163 zlarhs_(char *, char *, char *, char *, integer *, integer *,
00164 integer *, integer *, integer *, doublecomplex *, integer *,
00165 doublecomplex *, integer *, doublecomplex *, integer *, integer *,
00166 integer *), zlaset_(char *,
00167 integer *, integer *, doublecomplex *, doublecomplex *,
00168 doublecomplex *, integer *), zgbtrs_(char *, integer *,
00169 integer *, integer *, integer *, doublecomplex *, integer *,
00170 integer *, doublecomplex *, integer *, integer *),
00171 zlatms_(integer *, integer *, char *, integer *, char *,
00172 doublereal *, integer *, doublereal *, doublereal *, integer *,
00173 integer *, char *, doublecomplex *, integer *, doublecomplex *,
00174 integer *);
00175 doublereal result[7];
00176 extern int zgbsvx_(char *, char *, integer *, integer *,
00177 integer *, integer *, doublecomplex *, integer *, doublecomplex *,
00178 integer *, integer *, char *, doublereal *, doublereal *,
00179 doublecomplex *, integer *, doublecomplex *, integer *,
00180 doublereal *, doublereal *, doublereal *, doublecomplex *,
00181 doublereal *, integer *);
00182 doublereal rpvgrw;
00183 extern int zerrvx_(char *, integer *);
00184
00185
00186 static cilist io___26 = { 0, 0, 0, fmt_9999, 0 };
00187 static cilist io___27 = { 0, 0, 0, fmt_9998, 0 };
00188 static cilist io___65 = { 0, 0, 0, fmt_9997, 0 };
00189 static cilist io___73 = { 0, 0, 0, fmt_9995, 0 };
00190 static cilist io___74 = { 0, 0, 0, fmt_9996, 0 };
00191 static cilist io___75 = { 0, 0, 0, fmt_9995, 0 };
00192 static cilist io___76 = { 0, 0, 0, fmt_9996, 0 };
00193 static cilist io___77 = { 0, 0, 0, fmt_9995, 0 };
00194 static cilist io___78 = { 0, 0, 0, fmt_9996, 0 };
00195 static cilist io___79 = { 0, 0, 0, fmt_9995, 0 };
00196 static cilist io___80 = { 0, 0, 0, fmt_9996, 0 };
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295 --iwork;
00296 --rwork;
00297 --work;
00298 --s;
00299 --xact;
00300 --x;
00301 --bsav;
00302 --b;
00303 --asav;
00304 --afb;
00305 --a;
00306 --nval;
00307 --dotype;
00308
00309
00310
00311
00312
00313
00314
00315 s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00316 s_copy(path + 1, "GB", (ftnlen)2, (ftnlen)2);
00317 nrun = 0;
00318 nfail = 0;
00319 nerrs = 0;
00320 for (i__ = 1; i__ <= 4; ++i__) {
00321 iseed[i__ - 1] = iseedy[i__ - 1];
00322
00323 }
00324
00325
00326
00327 if (*tsterr) {
00328 zerrvx_(path, nout);
00329 }
00330 infoc_1.infot = 0;
00331
00332
00333
00334 nb = 1;
00335 nbmin = 2;
00336 xlaenv_(&c__1, &nb);
00337 xlaenv_(&c__2, &nbmin);
00338
00339
00340
00341 i__1 = *nn;
00342 for (in = 1; in <= i__1; ++in) {
00343 n = nval[in];
00344 ldb = max(n,1);
00345 *(unsigned char *)xtype = 'N';
00346
00347
00348
00349
00350 i__2 = 1, i__3 = min(n,4);
00351 nkl = max(i__2,i__3);
00352 if (n == 0) {
00353 nkl = 1;
00354 }
00355 nku = nkl;
00356 nimat = 8;
00357 if (n <= 0) {
00358 nimat = 1;
00359 }
00360
00361 i__2 = nkl;
00362 for (ikl = 1; ikl <= i__2; ++ikl) {
00363
00364
00365
00366
00367 if (ikl == 1) {
00368 kl = 0;
00369 } else if (ikl == 2) {
00370
00371 i__3 = n - 1;
00372 kl = max(i__3,0);
00373 } else if (ikl == 3) {
00374 kl = (n * 3 - 1) / 4;
00375 } else if (ikl == 4) {
00376 kl = (n + 1) / 4;
00377 }
00378 i__3 = nku;
00379 for (iku = 1; iku <= i__3; ++iku) {
00380
00381
00382
00383
00384
00385 if (iku == 1) {
00386 ku = 0;
00387 } else if (iku == 2) {
00388
00389 i__4 = n - 1;
00390 ku = max(i__4,0);
00391 } else if (iku == 3) {
00392 ku = (n * 3 - 1) / 4;
00393 } else if (iku == 4) {
00394 ku = (n + 1) / 4;
00395 }
00396
00397
00398
00399
00400 lda = kl + ku + 1;
00401 ldafb = (kl << 1) + ku + 1;
00402 if (lda * n > *la || ldafb * n > *lafb) {
00403 if (nfail == 0 && nerrs == 0) {
00404 aladhd_(nout, path);
00405 }
00406 if (lda * n > *la) {
00407 io___26.ciunit = *nout;
00408 s_wsfe(&io___26);
00409 do_fio(&c__1, (char *)&(*la), (ftnlen)sizeof(integer))
00410 ;
00411 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00412 do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00413 do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00414 i__4 = n * (kl + ku + 1);
00415 do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer));
00416 e_wsfe();
00417 ++nerrs;
00418 }
00419 if (ldafb * n > *lafb) {
00420 io___27.ciunit = *nout;
00421 s_wsfe(&io___27);
00422 do_fio(&c__1, (char *)&(*lafb), (ftnlen)sizeof(
00423 integer));
00424 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00425 do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00426 do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00427 i__4 = n * ((kl << 1) + ku + 1);
00428 do_fio(&c__1, (char *)&i__4, (ftnlen)sizeof(integer));
00429 e_wsfe();
00430 ++nerrs;
00431 }
00432 goto L130;
00433 }
00434
00435 i__4 = nimat;
00436 for (imat = 1; imat <= i__4; ++imat) {
00437
00438
00439
00440 if (! dotype[imat]) {
00441 goto L120;
00442 }
00443
00444
00445
00446 zerot = imat >= 2 && imat <= 4;
00447 if (zerot && n < imat - 1) {
00448 goto L120;
00449 }
00450
00451
00452
00453
00454 zlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &
00455 mode, &cndnum, dist);
00456 rcondc = 1. / cndnum;
00457
00458 s_copy(srnamc_1.srnamt, "ZLATMS", (ftnlen)32, (ftnlen)6);
00459 zlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00460 cndnum, &anorm, &kl, &ku, "Z", &a[1], &lda, &work[
00461 1], &info);
00462
00463
00464
00465 if (info != 0) {
00466 alaerh_(path, "ZLATMS", &info, &c__0, " ", &n, &n, &
00467 kl, &ku, &c_n1, &imat, &nfail, &nerrs, nout);
00468 goto L120;
00469 }
00470
00471
00472
00473
00474 izero = 0;
00475 if (zerot) {
00476 if (imat == 2) {
00477 izero = 1;
00478 } else if (imat == 3) {
00479 izero = n;
00480 } else {
00481 izero = n / 2 + 1;
00482 }
00483 ioff = (izero - 1) * lda;
00484 if (imat < 4) {
00485
00486 i__5 = 1, i__6 = ku + 2 - izero;
00487 i1 = max(i__5,i__6);
00488
00489 i__5 = kl + ku + 1, i__6 = ku + 1 + (n - izero);
00490 i2 = min(i__5,i__6);
00491 i__5 = i2;
00492 for (i__ = i1; i__ <= i__5; ++i__) {
00493 i__6 = ioff + i__;
00494 a[i__6].r = 0., a[i__6].i = 0.;
00495
00496 }
00497 } else {
00498 i__5 = n;
00499 for (j = izero; j <= i__5; ++j) {
00500
00501 i__6 = 1, i__7 = ku + 2 - j;
00502
00503 i__9 = kl + ku + 1, i__10 = ku + 1 + (n - j);
00504 i__8 = min(i__9,i__10);
00505 for (i__ = max(i__6,i__7); i__ <= i__8; ++i__)
00506 {
00507 i__6 = ioff + i__;
00508 a[i__6].r = 0., a[i__6].i = 0.;
00509
00510 }
00511 ioff += lda;
00512
00513 }
00514 }
00515 }
00516
00517
00518
00519 i__5 = kl + ku + 1;
00520 zlacpy_("Full", &i__5, &n, &a[1], &lda, &asav[1], &lda);
00521
00522 for (iequed = 1; iequed <= 4; ++iequed) {
00523 *(unsigned char *)equed = *(unsigned char *)&equeds[
00524 iequed - 1];
00525 if (iequed == 1) {
00526 nfact = 3;
00527 } else {
00528 nfact = 1;
00529 }
00530
00531 i__5 = nfact;
00532 for (ifact = 1; ifact <= i__5; ++ifact) {
00533 *(unsigned char *)fact = *(unsigned char *)&facts[
00534 ifact - 1];
00535 prefac = lsame_(fact, "F");
00536 nofact = lsame_(fact, "N");
00537 equil = lsame_(fact, "E");
00538
00539 if (zerot) {
00540 if (prefac) {
00541 goto L100;
00542 }
00543 rcondo = 0.;
00544 rcondi = 0.;
00545
00546 } else if (! nofact) {
00547
00548
00549
00550
00551
00552
00553 i__8 = kl + ku + 1;
00554 zlacpy_("Full", &i__8, &n, &asav[1], &lda, &
00555 afb[kl + 1], &ldafb);
00556 if (equil || iequed > 1) {
00557
00558
00559
00560
00561 zgbequ_(&n, &n, &kl, &ku, &afb[kl + 1], &
00562 ldafb, &s[1], &s[n + 1], &rowcnd,
00563 &colcnd, &amax, &info);
00564 if (info == 0 && n > 0) {
00565 if (lsame_(equed, "R")) {
00566 rowcnd = 0.;
00567 colcnd = 1.;
00568 } else if (lsame_(equed, "C")) {
00569 rowcnd = 1.;
00570 colcnd = 0.;
00571 } else if (lsame_(equed, "B")) {
00572 rowcnd = 0.;
00573 colcnd = 0.;
00574 }
00575
00576
00577
00578 zlaqgb_(&n, &n, &kl, &ku, &afb[kl + 1]
00579 , &ldafb, &s[1], &s[n + 1], &
00580 rowcnd, &colcnd, &amax, equed);
00581 }
00582 }
00583
00584
00585
00586
00587 if (equil) {
00588 roldo = rcondo;
00589 roldi = rcondi;
00590 }
00591
00592
00593
00594 anormo = zlangb_("1", &n, &kl, &ku, &afb[kl +
00595 1], &ldafb, &rwork[1]);
00596 anormi = zlangb_("I", &n, &kl, &ku, &afb[kl +
00597 1], &ldafb, &rwork[1]);
00598
00599
00600
00601 zgbtrf_(&n, &n, &kl, &ku, &afb[1], &ldafb, &
00602 iwork[1], &info);
00603
00604
00605
00606 zlaset_("Full", &n, &n, &c_b48, &c_b49, &work[
00607 1], &ldb);
00608 s_copy(srnamc_1.srnamt, "ZGBTRS", (ftnlen)32,
00609 (ftnlen)6);
00610 zgbtrs_("No transpose", &n, &kl, &ku, &n, &
00611 afb[1], &ldafb, &iwork[1], &work[1], &
00612 ldb, &info);
00613
00614
00615
00616 ainvnm = zlange_("1", &n, &n, &work[1], &ldb,
00617 &rwork[1]);
00618 if (anormo <= 0. || ainvnm <= 0.) {
00619 rcondo = 1.;
00620 } else {
00621 rcondo = 1. / anormo / ainvnm;
00622 }
00623
00624
00625
00626
00627 ainvnm = zlange_("I", &n, &n, &work[1], &ldb,
00628 &rwork[1]);
00629 if (anormi <= 0. || ainvnm <= 0.) {
00630 rcondi = 1.;
00631 } else {
00632 rcondi = 1. / anormi / ainvnm;
00633 }
00634 }
00635
00636 for (itran = 1; itran <= 3; ++itran) {
00637
00638
00639
00640 *(unsigned char *)trans = *(unsigned char *)&
00641 transs[itran - 1];
00642 if (itran == 1) {
00643 rcondc = rcondo;
00644 } else {
00645 rcondc = rcondi;
00646 }
00647
00648
00649
00650 i__8 = kl + ku + 1;
00651 zlacpy_("Full", &i__8, &n, &asav[1], &lda, &a[
00652 1], &lda);
00653
00654
00655
00656
00657 s_copy(srnamc_1.srnamt, "ZLARHS", (ftnlen)32,
00658 (ftnlen)6);
00659 zlarhs_(path, xtype, "Full", trans, &n, &n, &
00660 kl, &ku, nrhs, &a[1], &lda, &xact[1],
00661 &ldb, &b[1], &ldb, iseed, &info);
00662 *(unsigned char *)xtype = 'C';
00663 zlacpy_("Full", &n, nrhs, &b[1], &ldb, &bsav[
00664 1], &ldb);
00665
00666 if (nofact && itran == 1) {
00667
00668
00669
00670
00671
00672
00673 i__8 = kl + ku + 1;
00674 zlacpy_("Full", &i__8, &n, &a[1], &lda, &
00675 afb[kl + 1], &ldafb);
00676 zlacpy_("Full", &n, nrhs, &b[1], &ldb, &x[
00677 1], &ldb);
00678
00679 s_copy(srnamc_1.srnamt, "ZGBSV ", (ftnlen)
00680 32, (ftnlen)6);
00681 zgbsv_(&n, &kl, &ku, nrhs, &afb[1], &
00682 ldafb, &iwork[1], &x[1], &ldb, &
00683 info);
00684
00685
00686
00687 if (info != izero) {
00688 alaerh_(path, "ZGBSV ", &info, &izero,
00689 " ", &n, &n, &kl, &ku, nrhs,
00690 &imat, &nfail, &nerrs, nout);
00691 }
00692
00693
00694
00695
00696 zgbt01_(&n, &n, &kl, &ku, &a[1], &lda, &
00697 afb[1], &ldafb, &iwork[1], &work[
00698 1], result);
00699 nt = 1;
00700 if (izero == 0) {
00701
00702
00703
00704
00705 zlacpy_("Full", &n, nrhs, &b[1], &ldb,
00706 &work[1], &ldb);
00707 zgbt02_("No transpose", &n, &n, &kl, &
00708 ku, nrhs, &a[1], &lda, &x[1],
00709 &ldb, &work[1], &ldb, &result[
00710 1]);
00711
00712
00713
00714
00715 zget04_(&n, nrhs, &x[1], &ldb, &xact[
00716 1], &ldb, &rcondc, &result[2])
00717 ;
00718 nt = 3;
00719 }
00720
00721
00722
00723
00724 i__8 = nt;
00725 for (k = 1; k <= i__8; ++k) {
00726 if (result[k - 1] >= *thresh) {
00727 if (nfail == 0 && nerrs == 0) {
00728 aladhd_(nout, path);
00729 }
00730 io___65.ciunit = *nout;
00731 s_wsfe(&io___65);
00732 do_fio(&c__1, "ZGBSV ", (ftnlen)6)
00733 ;
00734 do_fio(&c__1, (char *)&n, (ftnlen)
00735 sizeof(integer));
00736 do_fio(&c__1, (char *)&kl, (
00737 ftnlen)sizeof(integer));
00738 do_fio(&c__1, (char *)&ku, (
00739 ftnlen)sizeof(integer));
00740 do_fio(&c__1, (char *)&imat, (
00741 ftnlen)sizeof(integer));
00742 do_fio(&c__1, (char *)&k, (ftnlen)
00743 sizeof(integer));
00744 do_fio(&c__1, (char *)&result[k -
00745 1], (ftnlen)sizeof(
00746 doublereal));
00747 e_wsfe();
00748 ++nfail;
00749 }
00750
00751 }
00752 nrun += nt;
00753 }
00754
00755
00756
00757 if (! prefac) {
00758 i__8 = (kl << 1) + ku + 1;
00759 zlaset_("Full", &i__8, &n, &c_b48, &c_b48,
00760 &afb[1], &ldafb);
00761 }
00762 zlaset_("Full", &n, nrhs, &c_b48, &c_b48, &x[
00763 1], &ldb);
00764 if (iequed > 1 && n > 0) {
00765
00766
00767
00768
00769 zlaqgb_(&n, &n, &kl, &ku, &a[1], &lda, &s[
00770 1], &s[n + 1], &rowcnd, &colcnd, &
00771 amax, equed);
00772 }
00773
00774
00775
00776
00777 s_copy(srnamc_1.srnamt, "ZGBSVX", (ftnlen)32,
00778 (ftnlen)6);
00779 zgbsvx_(fact, trans, &n, &kl, &ku, nrhs, &a[1]
00780 , &lda, &afb[1], &ldafb, &iwork[1],
00781 equed, &s[1], &s[ldb + 1], &b[1], &
00782 ldb, &x[1], &ldb, &rcond, &rwork[1], &
00783 rwork[*nrhs + 1], &work[1], &rwork[(*
00784 nrhs << 1) + 1], &info);
00785
00786
00787
00788 if (info != izero) {
00789
00790 i__11[0] = 1, a__1[0] = fact;
00791 i__11[1] = 1, a__1[1] = trans;
00792 s_cat(ch__1, a__1, i__11, &c__2, (ftnlen)
00793 2);
00794 alaerh_(path, "ZGBSVX", &info, &izero,
00795 ch__1, &n, &n, &kl, &ku, nrhs, &
00796 imat, &nfail, &nerrs, nout);
00797 }
00798
00799
00800
00801 if (info != 0) {
00802 anrmpv = 0.;
00803 i__8 = info;
00804 for (j = 1; j <= i__8; ++j) {
00805
00806 i__6 = ku + 2 - j;
00807
00808 i__9 = n + ku + 1 - j, i__10 = kl +
00809 ku + 1;
00810 i__7 = min(i__9,i__10);
00811 for (i__ = max(i__6,1); i__ <= i__7;
00812 ++i__) {
00813
00814 d__1 = anrmpv, d__2 = z_abs(&a[
00815 i__ + (j - 1) * lda]);
00816 anrmpv = max(d__1,d__2);
00817
00818 }
00819
00820 }
00821
00822 i__7 = info - 1, i__6 = kl + ku;
00823 i__8 = min(i__7,i__6);
00824
00825 i__9 = 1, i__10 = kl + ku + 2 - info;
00826 rpvgrw = zlantb_("M", "U", "N", &info, &
00827 i__8, &afb[max(i__9, i__10)], &
00828 ldafb, rdum);
00829 if (rpvgrw == 0.) {
00830 rpvgrw = 1.;
00831 } else {
00832 rpvgrw = anrmpv / rpvgrw;
00833 }
00834 } else {
00835 i__8 = kl + ku;
00836 rpvgrw = zlantb_("M", "U", "N", &n, &i__8,
00837 &afb[1], &ldafb, rdum);
00838 if (rpvgrw == 0.) {
00839 rpvgrw = 1.;
00840 } else {
00841 rpvgrw = zlangb_("M", &n, &kl, &ku, &
00842 a[1], &lda, rdum) /
00843 rpvgrw;
00844 }
00845 }
00846
00847 d__2 = rwork[(*nrhs << 1) + 1];
00848 result[6] = (d__1 = rpvgrw - rwork[(*nrhs <<
00849 1) + 1], abs(d__1)) / max(d__2,rpvgrw)
00850 / dlamch_("E");
00851
00852 if (! prefac) {
00853
00854
00855
00856
00857 zgbt01_(&n, &n, &kl, &ku, &a[1], &lda, &
00858 afb[1], &ldafb, &iwork[1], &work[
00859 1], result);
00860 k1 = 1;
00861 } else {
00862 k1 = 2;
00863 }
00864
00865 if (info == 0) {
00866 trfcon = FALSE_;
00867
00868
00869
00870 zlacpy_("Full", &n, nrhs, &bsav[1], &ldb,
00871 &work[1], &ldb);
00872 zgbt02_(trans, &n, &n, &kl, &ku, nrhs, &
00873 asav[1], &lda, &x[1], &ldb, &work[
00874 1], &ldb, &result[1]);
00875
00876
00877
00878
00879 if (nofact || prefac && lsame_(equed,
00880 "N")) {
00881 zget04_(&n, nrhs, &x[1], &ldb, &xact[
00882 1], &ldb, &rcondc, &result[2])
00883 ;
00884 } else {
00885 if (itran == 1) {
00886 roldc = roldo;
00887 } else {
00888 roldc = roldi;
00889 }
00890 zget04_(&n, nrhs, &x[1], &ldb, &xact[
00891 1], &ldb, &roldc, &result[2]);
00892 }
00893
00894
00895
00896
00897 zgbt05_(trans, &n, &kl, &ku, nrhs, &asav[
00898 1], &lda, &bsav[1], &ldb, &x[1], &
00899 ldb, &xact[1], &ldb, &rwork[1], &
00900 rwork[*nrhs + 1], &result[3]);
00901 } else {
00902 trfcon = TRUE_;
00903 }
00904
00905
00906
00907
00908 result[5] = dget06_(&rcond, &rcondc);
00909
00910
00911
00912
00913 if (! trfcon) {
00914 for (k = k1; k <= 7; ++k) {
00915 if (result[k - 1] >= *thresh) {
00916 if (nfail == 0 && nerrs == 0) {
00917 aladhd_(nout, path);
00918 }
00919 if (prefac) {
00920 io___73.ciunit = *nout;
00921 s_wsfe(&io___73);
00922 do_fio(&c__1, "ZGBSVX", (ftnlen)6);
00923 do_fio(&c__1, fact, (ftnlen)1);
00924 do_fio(&c__1, trans, (ftnlen)1);
00925 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00926 do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00927 do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00928 do_fio(&c__1, equed, (ftnlen)1);
00929 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer)
00930 );
00931 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
00932 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00933 sizeof(doublereal));
00934 e_wsfe();
00935 } else {
00936 io___74.ciunit = *nout;
00937 s_wsfe(&io___74);
00938 do_fio(&c__1, "ZGBSVX", (ftnlen)6);
00939 do_fio(&c__1, fact, (ftnlen)1);
00940 do_fio(&c__1, trans, (ftnlen)1);
00941 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00942 do_fio(&c__1, (char *)&kl, (ftnlen)sizeof(integer));
00943 do_fio(&c__1, (char *)&ku, (ftnlen)sizeof(integer));
00944 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer)
00945 );
00946 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer));
00947 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00948 sizeof(doublereal));
00949 e_wsfe();
00950 }
00951 ++nfail;
00952 }
00953
00954 }
00955 nrun = nrun + 7 - k1;
00956 } else {
00957 if (result[0] >= *thresh && ! prefac) {
00958 if (nfail == 0 && nerrs == 0) {
00959 aladhd_(nout, path);
00960 }
00961 if (prefac) {
00962 io___75.ciunit = *nout;
00963 s_wsfe(&io___75);
00964 do_fio(&c__1, "ZGBSVX", (ftnlen)6)
00965 ;
00966 do_fio(&c__1, fact, (ftnlen)1);
00967 do_fio(&c__1, trans, (ftnlen)1);
00968 do_fio(&c__1, (char *)&n, (ftnlen)
00969 sizeof(integer));
00970 do_fio(&c__1, (char *)&kl, (
00971 ftnlen)sizeof(integer));
00972 do_fio(&c__1, (char *)&ku, (
00973 ftnlen)sizeof(integer));
00974 do_fio(&c__1, equed, (ftnlen)1);
00975 do_fio(&c__1, (char *)&imat, (
00976 ftnlen)sizeof(integer));
00977 do_fio(&c__1, (char *)&c__1, (
00978 ftnlen)sizeof(integer));
00979 do_fio(&c__1, (char *)&result[0],
00980 (ftnlen)sizeof(doublereal)
00981 );
00982 e_wsfe();
00983 } else {
00984 io___76.ciunit = *nout;
00985 s_wsfe(&io___76);
00986 do_fio(&c__1, "ZGBSVX", (ftnlen)6)
00987 ;
00988 do_fio(&c__1, fact, (ftnlen)1);
00989 do_fio(&c__1, trans, (ftnlen)1);
00990 do_fio(&c__1, (char *)&n, (ftnlen)
00991 sizeof(integer));
00992 do_fio(&c__1, (char *)&kl, (
00993 ftnlen)sizeof(integer));
00994 do_fio(&c__1, (char *)&ku, (
00995 ftnlen)sizeof(integer));
00996 do_fio(&c__1, (char *)&imat, (
00997 ftnlen)sizeof(integer));
00998 do_fio(&c__1, (char *)&c__1, (
00999 ftnlen)sizeof(integer));
01000 do_fio(&c__1, (char *)&result[0],
01001 (ftnlen)sizeof(doublereal)
01002 );
01003 e_wsfe();
01004 }
01005 ++nfail;
01006 ++nrun;
01007 }
01008 if (result[5] >= *thresh) {
01009 if (nfail == 0 && nerrs == 0) {
01010 aladhd_(nout, path);
01011 }
01012 if (prefac) {
01013 io___77.ciunit = *nout;
01014 s_wsfe(&io___77);
01015 do_fio(&c__1, "ZGBSVX", (ftnlen)6)
01016 ;
01017 do_fio(&c__1, fact, (ftnlen)1);
01018 do_fio(&c__1, trans, (ftnlen)1);
01019 do_fio(&c__1, (char *)&n, (ftnlen)
01020 sizeof(integer));
01021 do_fio(&c__1, (char *)&kl, (
01022 ftnlen)sizeof(integer));
01023 do_fio(&c__1, (char *)&ku, (
01024 ftnlen)sizeof(integer));
01025 do_fio(&c__1, equed, (ftnlen)1);
01026 do_fio(&c__1, (char *)&imat, (
01027 ftnlen)sizeof(integer));
01028 do_fio(&c__1, (char *)&c__6, (
01029 ftnlen)sizeof(integer));
01030 do_fio(&c__1, (char *)&result[5],
01031 (ftnlen)sizeof(doublereal)
01032 );
01033 e_wsfe();
01034 } else {
01035 io___78.ciunit = *nout;
01036 s_wsfe(&io___78);
01037 do_fio(&c__1, "ZGBSVX", (ftnlen)6)
01038 ;
01039 do_fio(&c__1, fact, (ftnlen)1);
01040 do_fio(&c__1, trans, (ftnlen)1);
01041 do_fio(&c__1, (char *)&n, (ftnlen)
01042 sizeof(integer));
01043 do_fio(&c__1, (char *)&kl, (
01044 ftnlen)sizeof(integer));
01045 do_fio(&c__1, (char *)&ku, (
01046 ftnlen)sizeof(integer));
01047 do_fio(&c__1, (char *)&imat, (
01048 ftnlen)sizeof(integer));
01049 do_fio(&c__1, (char *)&c__6, (
01050 ftnlen)sizeof(integer));
01051 do_fio(&c__1, (char *)&result[5],
01052 (ftnlen)sizeof(doublereal)
01053 );
01054 e_wsfe();
01055 }
01056 ++nfail;
01057 ++nrun;
01058 }
01059 if (result[6] >= *thresh) {
01060 if (nfail == 0 && nerrs == 0) {
01061 aladhd_(nout, path);
01062 }
01063 if (prefac) {
01064 io___79.ciunit = *nout;
01065 s_wsfe(&io___79);
01066 do_fio(&c__1, "ZGBSVX", (ftnlen)6)
01067 ;
01068 do_fio(&c__1, fact, (ftnlen)1);
01069 do_fio(&c__1, trans, (ftnlen)1);
01070 do_fio(&c__1, (char *)&n, (ftnlen)
01071 sizeof(integer));
01072 do_fio(&c__1, (char *)&kl, (
01073 ftnlen)sizeof(integer));
01074 do_fio(&c__1, (char *)&ku, (
01075 ftnlen)sizeof(integer));
01076 do_fio(&c__1, equed, (ftnlen)1);
01077 do_fio(&c__1, (char *)&imat, (
01078 ftnlen)sizeof(integer));
01079 do_fio(&c__1, (char *)&c__7, (
01080 ftnlen)sizeof(integer));
01081 do_fio(&c__1, (char *)&result[6],
01082 (ftnlen)sizeof(doublereal)
01083 );
01084 e_wsfe();
01085 } else {
01086 io___80.ciunit = *nout;
01087 s_wsfe(&io___80);
01088 do_fio(&c__1, "ZGBSVX", (ftnlen)6)
01089 ;
01090 do_fio(&c__1, fact, (ftnlen)1);
01091 do_fio(&c__1, trans, (ftnlen)1);
01092 do_fio(&c__1, (char *)&n, (ftnlen)
01093 sizeof(integer));
01094 do_fio(&c__1, (char *)&kl, (
01095 ftnlen)sizeof(integer));
01096 do_fio(&c__1, (char *)&ku, (
01097 ftnlen)sizeof(integer));
01098 do_fio(&c__1, (char *)&imat, (
01099 ftnlen)sizeof(integer));
01100 do_fio(&c__1, (char *)&c__7, (
01101 ftnlen)sizeof(integer));
01102 do_fio(&c__1, (char *)&result[6],
01103 (ftnlen)sizeof(doublereal)
01104 );
01105 e_wsfe();
01106 }
01107 ++nfail;
01108 ++nrun;
01109 }
01110 }
01111
01112 }
01113 L100:
01114 ;
01115 }
01116
01117 }
01118 L120:
01119 ;
01120 }
01121 L130:
01122 ;
01123 }
01124
01125 }
01126
01127 }
01128
01129
01130
01131 alasvm_(path, nout, &nfail, &nrun, &nerrs);
01132
01133
01134 return 0;
01135
01136
01137
01138 }