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 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 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
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
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
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
00080 int s_copy(char *, char *, ftnlen, ftnlen);
00081 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00082 int s_cat(char *, char **, integer *, integer *, ftnlen);
00083 double c_abs(complex *);
00084
00085
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 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 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 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 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 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 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 int cgbtrf_(integer *, integer *, integer *,
00149 integer *, complex *, integer *, integer *, integer *);
00150 integer iequed;
00151 extern int clacpy_(char *, integer *, integer *, complex
00152 *, integer *, complex *, integer *);
00153 real rcondi;
00154 extern 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 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 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 int cerrvx_(char *, integer *);
00174 real result[7], rpvgrw;
00175
00176
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
00192
00193
00194
00195
00196
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 --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
00301
00302
00303
00304
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
00314 }
00315
00316
00317
00318 if (*tsterr) {
00319 cerrvx_(path, nout);
00320 }
00321 infoc_1.infot = 0;
00322
00323
00324
00325 nb = 1;
00326 nbmin = 2;
00327 xlaenv_(&c__1, &nb);
00328 xlaenv_(&c__2, &nbmin);
00329
00330
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
00339
00340
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
00356
00357
00358 if (ikl == 1) {
00359 kl = 0;
00360 } else if (ikl == 2) {
00361
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
00373
00374
00375
00376 if (iku == 1) {
00377 ku = 0;
00378 } else if (iku == 2) {
00379
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
00389
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
00430
00431 if (! dotype[imat]) {
00432 goto L120;
00433 }
00434
00435
00436
00437 zerot = imat >= 2 && imat <= 4;
00438 if (zerot && n < imat - 1) {
00439 goto L120;
00440 }
00441
00442
00443
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
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
00463
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
00477 i__5 = 1, i__6 = ku + 2 - izero;
00478 i1 = max(i__5,i__6);
00479
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
00487 }
00488 } else {
00489 i__5 = n;
00490 for (j = izero; j <= i__5; ++j) {
00491
00492 i__6 = 1, i__7 = ku + 2 - j;
00493
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
00501 }
00502 ioff += lda;
00503
00504 }
00505 }
00506 }
00507
00508
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
00540
00541
00542
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
00550
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
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
00576
00577
00578 if (equil) {
00579 roldo = rcondo;
00580 roldi = rcondi;
00581 }
00582
00583
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
00591
00592 cgbtrf_(&n, &n, &kl, &ku, &afb[1], &ldafb, &
00593 iwork[1], &info);
00594
00595
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
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
00616
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
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
00640
00641 i__8 = kl + ku + 1;
00642 clacpy_("Full", &i__8, &n, &asav[1], &lda, &a[
00643 1], &lda);
00644
00645
00646
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
00660
00661
00662
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
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
00685
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
00694
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
00704
00705
00706 cget04_(&n, nrhs, &x[1], &ldb, &xact[
00707 1], &ldb, &rcondc, &result[2])
00708 ;
00709 nt = 3;
00710 }
00711
00712
00713
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
00741 }
00742 nrun += nt;
00743 }
00744
00745
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
00757
00758
00759 claqgb_(&n, &n, &kl, &ku, &a[1], &lda, &s[
00760 1], &s[n + 1], &rowcnd, &colcnd, &
00761 amax, equed);
00762 }
00763
00764
00765
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
00777
00778 if (info != izero) {
00779
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
00789
00790
00791 if (info != 0) {
00792 anrmpv = 0.f;
00793 i__8 = info;
00794 for (j = 1; j <= i__8; ++j) {
00795
00796 i__6 = ku + 2 - j;
00797
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
00804 r__1 = anrmpv, r__2 = c_abs(&a[
00805 i__ + (j - 1) * lda]);
00806 anrmpv = dmax(r__1,r__2);
00807
00808 }
00809
00810 }
00811
00812 i__7 = info - 1, i__6 = kl + ku;
00813 i__8 = min(i__7,i__6);
00814
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
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
00845
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
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
00867
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
00885
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
00896
00897
00898 result[5] = sget06_(&rcond, &rcondc);
00899
00900
00901
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
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
01096 }
01097 L100:
01098 ;
01099 }
01100
01101 }
01102 L120:
01103 ;
01104 }
01105 L130:
01106 ;
01107 }
01108
01109 }
01110
01111 }
01112
01113
01114
01115 alasvm_(path, nout, &nfail, &nrun, &nerrs);
01116
01117
01118 return 0;
01119
01120
01121
01122 }