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__2 = 2;
00034 static integer c__0 = 0;
00035 static integer c_n1 = -1;
00036 static integer c__1 = 1;
00037 static doublereal c_b50 = 0.;
00038 static doublereal c_b51 = 1.;
00039 static integer c__7 = 7;
00040
00041 int dchkpb_(logical *dotype, integer *nn, integer *nval,
00042 integer *nnb, integer *nbval, integer *nns, integer *nsval,
00043 doublereal *thresh, logical *tsterr, integer *nmax, doublereal *a,
00044 doublereal *afac, doublereal *ainv, doublereal *b, doublereal *x,
00045 doublereal *xact, doublereal *work, doublereal *rwork, integer *iwork,
00046 integer *nout)
00047 {
00048
00049
00050 static integer iseedy[4] = { 1988,1989,1990,1991 };
00051
00052
00053 static char fmt_9999[] = "(\002 UPLO='\002,a1,\002', N=\002,i5,\002, KD"
00054 "=\002,i5,\002, NB=\002,i4,\002, type \002,i2,\002, test \002,i2"
00055 ",\002, ratio= \002,g12.5)";
00056 static char fmt_9998[] = "(\002 UPLO='\002,a1,\002', N=\002,i5,\002, KD"
00057 "=\002,i5,\002, NRHS=\002,i3,\002, type \002,i2,\002, test(\002,i"
00058 "2,\002) = \002,g12.5)";
00059 static char fmt_9997[] = "(\002 UPLO='\002,a1,\002', N=\002,i5,\002, KD"
00060 "=\002,i5,\002,\002,10x,\002 type \002,i2,\002, test(\002,i2,\002"
00061 ") = \002,g12.5)";
00062
00063
00064 integer i__1, i__2, i__3, i__4, i__5, i__6;
00065
00066
00067 int s_copy(char *, char *, ftnlen, ftnlen);
00068 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00069
00070
00071 integer i__, k, n, i1, i2, kd, nb, in, kl, iw, ku, lda, ikd, inb, nkd,
00072 ldab, ioff, mode, koff, imat, info;
00073 char path[3], dist[1];
00074 integer irhs, nrhs;
00075 char uplo[1], type__[1];
00076 integer nrun;
00077 extern int alahd_(integer *, char *), dget04_(
00078 integer *, integer *, doublereal *, integer *, doublereal *,
00079 integer *, doublereal *, doublereal *);
00080 integer nfail, iseed[4];
00081 extern doublereal dget06_(doublereal *, doublereal *);
00082 extern int dpbt01_(char *, integer *, integer *,
00083 doublereal *, integer *, doublereal *, integer *, doublereal *,
00084 doublereal *), dpbt02_(char *, integer *, integer *,
00085 integer *, doublereal *, integer *, doublereal *, integer *,
00086 doublereal *, integer *, doublereal *, doublereal *),
00087 dpbt05_(char *, integer *, integer *, integer *, doublereal *,
00088 integer *, doublereal *, integer *, doublereal *, integer *,
00089 doublereal *, integer *, doublereal *, doublereal *, doublereal *);
00090 integer kdval[4];
00091 doublereal rcond;
00092 integer nimat;
00093 doublereal anorm;
00094 extern int dcopy_(integer *, doublereal *, integer *,
00095 doublereal *, integer *), dswap_(integer *, doublereal *, integer
00096 *, doublereal *, integer *);
00097 integer iuplo, izero, nerrs;
00098 logical zerot;
00099 char xtype[1];
00100 extern int dlatb4_(char *, integer *, integer *, integer
00101 *, char *, integer *, integer *, doublereal *, integer *,
00102 doublereal *, char *);
00103 extern doublereal dlange_(char *, integer *, integer *, doublereal *,
00104 integer *, doublereal *);
00105 extern int alaerh_(char *, char *, integer *, integer *,
00106 char *, integer *, integer *, integer *, integer *, integer *,
00107 integer *, integer *, integer *, integer *);
00108 extern doublereal dlansb_(char *, char *, integer *, integer *,
00109 doublereal *, integer *, doublereal *);
00110 extern int dpbcon_(char *, integer *, integer *,
00111 doublereal *, integer *, doublereal *, doublereal *, doublereal *,
00112 integer *, integer *);
00113 doublereal rcondc;
00114 char packit[1];
00115 extern int dlacpy_(char *, integer *, integer *,
00116 doublereal *, integer *, doublereal *, integer *),
00117 dlarhs_(char *, char *, char *, char *, integer *, integer *,
00118 integer *, integer *, integer *, doublereal *, integer *,
00119 doublereal *, integer *, doublereal *, integer *, integer *,
00120 integer *), dlaset_(char *,
00121 integer *, integer *, doublereal *, doublereal *, doublereal *,
00122 integer *), dpbrfs_(char *, integer *, integer *, integer
00123 *, doublereal *, integer *, doublereal *, integer *, doublereal *,
00124 integer *, doublereal *, integer *, doublereal *, doublereal *,
00125 doublereal *, integer *, integer *), dpbtrf_(char *,
00126 integer *, integer *, doublereal *, integer *, integer *),
00127 alasum_(char *, integer *, integer *, integer *, integer *);
00128 doublereal cndnum;
00129 extern int dlatms_(integer *, integer *, char *, integer
00130 *, char *, doublereal *, integer *, doublereal *, doublereal *,
00131 integer *, integer *, char *, doublereal *, integer *, doublereal
00132 *, integer *);
00133 doublereal ainvnm;
00134 extern int derrpo_(char *, integer *), dpbtrs_(
00135 char *, integer *, integer *, integer *, doublereal *, integer *,
00136 doublereal *, integer *, integer *), xlaenv_(integer *,
00137 integer *);
00138 doublereal result[7];
00139
00140
00141 static cilist io___40 = { 0, 0, 0, fmt_9999, 0 };
00142 static cilist io___46 = { 0, 0, 0, fmt_9998, 0 };
00143 static cilist io___48 = { 0, 0, 0, fmt_9997, 0 };
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
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 --iwork;
00244 --rwork;
00245 --work;
00246 --xact;
00247 --x;
00248 --b;
00249 --ainv;
00250 --afac;
00251 --a;
00252 --nsval;
00253 --nbval;
00254 --nval;
00255 --dotype;
00256
00257
00258
00259
00260
00261
00262
00263 s_copy(path, "Double precision", (ftnlen)1, (ftnlen)16);
00264 s_copy(path + 1, "PB", (ftnlen)2, (ftnlen)2);
00265 nrun = 0;
00266 nfail = 0;
00267 nerrs = 0;
00268 for (i__ = 1; i__ <= 4; ++i__) {
00269 iseed[i__ - 1] = iseedy[i__ - 1];
00270
00271 }
00272
00273
00274
00275 if (*tsterr) {
00276 derrpo_(path, nout);
00277 }
00278 infoc_1.infot = 0;
00279 xlaenv_(&c__2, &c__2);
00280 kdval[0] = 0;
00281
00282
00283
00284 i__1 = *nn;
00285 for (in = 1; in <= i__1; ++in) {
00286 n = nval[in];
00287 lda = max(n,1);
00288 *(unsigned char *)xtype = 'N';
00289
00290
00291
00292
00293 i__2 = 1, i__3 = min(n,4);
00294 nkd = max(i__2,i__3);
00295 nimat = 8;
00296 if (n == 0) {
00297 nimat = 1;
00298 }
00299
00300 kdval[1] = n + (n + 1) / 4;
00301 kdval[2] = (n * 3 - 1) / 4;
00302 kdval[3] = (n + 1) / 4;
00303
00304 i__2 = nkd;
00305 for (ikd = 1; ikd <= i__2; ++ikd) {
00306
00307
00308
00309
00310
00311 kd = kdval[ikd - 1];
00312 ldab = kd + 1;
00313
00314
00315
00316 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00317 koff = 1;
00318 if (iuplo == 1) {
00319 *(unsigned char *)uplo = 'U';
00320
00321 i__3 = 1, i__4 = kd + 2 - n;
00322 koff = max(i__3,i__4);
00323 *(unsigned char *)packit = 'Q';
00324 } else {
00325 *(unsigned char *)uplo = 'L';
00326 *(unsigned char *)packit = 'B';
00327 }
00328
00329 i__3 = nimat;
00330 for (imat = 1; imat <= i__3; ++imat) {
00331
00332
00333
00334 if (! dotype[imat]) {
00335 goto L60;
00336 }
00337
00338
00339
00340 zerot = imat >= 2 && imat <= 4;
00341 if (zerot && n < imat - 1) {
00342 goto L60;
00343 }
00344
00345 if (! zerot || ! dotype[1]) {
00346
00347
00348
00349
00350 dlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm,
00351 &mode, &cndnum, dist);
00352
00353 s_copy(srnamc_1.srnamt, "DLATMS", (ftnlen)32, (ftnlen)
00354 6);
00355 dlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode,
00356 &cndnum, &anorm, &kd, &kd, packit, &a[koff],
00357 &ldab, &work[1], &info);
00358
00359
00360
00361 if (info != 0) {
00362 alaerh_(path, "DLATMS", &info, &c__0, uplo, &n, &
00363 n, &kd, &kd, &c_n1, &imat, &nfail, &nerrs,
00364 nout);
00365 goto L60;
00366 }
00367 } else if (izero > 0) {
00368
00369
00370
00371
00372 iw = (lda << 1) + 1;
00373 if (iuplo == 1) {
00374 ioff = (izero - 1) * ldab + kd + 1;
00375 i__4 = izero - i1;
00376 dcopy_(&i__4, &work[iw], &c__1, &a[ioff - izero +
00377 i1], &c__1);
00378 iw = iw + izero - i1;
00379 i__4 = i2 - izero + 1;
00380
00381 i__6 = ldab - 1;
00382 i__5 = max(i__6,1);
00383 dcopy_(&i__4, &work[iw], &c__1, &a[ioff], &i__5);
00384 } else {
00385 ioff = (i1 - 1) * ldab + 1;
00386 i__4 = izero - i1;
00387
00388 i__6 = ldab - 1;
00389 i__5 = max(i__6,1);
00390 dcopy_(&i__4, &work[iw], &c__1, &a[ioff + izero -
00391 i1], &i__5);
00392 ioff = (izero - 1) * ldab + 1;
00393 iw = iw + izero - i1;
00394 i__4 = i2 - izero + 1;
00395 dcopy_(&i__4, &work[iw], &c__1, &a[ioff], &c__1);
00396 }
00397 }
00398
00399
00400
00401
00402 izero = 0;
00403 if (zerot) {
00404 if (imat == 2) {
00405 izero = 1;
00406 } else if (imat == 3) {
00407 izero = n;
00408 } else {
00409 izero = n / 2 + 1;
00410 }
00411
00412
00413
00414 iw = lda << 1;
00415
00416 i__5 = (kd << 1) + 1;
00417 i__4 = min(i__5,n);
00418 for (i__ = 1; i__ <= i__4; ++i__) {
00419 work[iw + i__] = 0.;
00420
00421 }
00422 ++iw;
00423
00424 i__4 = izero - kd;
00425 i1 = max(i__4,1);
00426
00427 i__4 = izero + kd;
00428 i2 = min(i__4,n);
00429
00430 if (iuplo == 1) {
00431 ioff = (izero - 1) * ldab + kd + 1;
00432 i__4 = izero - i1;
00433 dswap_(&i__4, &a[ioff - izero + i1], &c__1, &work[
00434 iw], &c__1);
00435 iw = iw + izero - i1;
00436 i__4 = i2 - izero + 1;
00437
00438 i__6 = ldab - 1;
00439 i__5 = max(i__6,1);
00440 dswap_(&i__4, &a[ioff], &i__5, &work[iw], &c__1);
00441 } else {
00442 ioff = (i1 - 1) * ldab + 1;
00443 i__4 = izero - i1;
00444
00445 i__6 = ldab - 1;
00446 i__5 = max(i__6,1);
00447 dswap_(&i__4, &a[ioff + izero - i1], &i__5, &work[
00448 iw], &c__1);
00449 ioff = (izero - 1) * ldab + 1;
00450 iw = iw + izero - i1;
00451 i__4 = i2 - izero + 1;
00452 dswap_(&i__4, &a[ioff], &c__1, &work[iw], &c__1);
00453 }
00454 }
00455
00456
00457
00458 i__4 = *nnb;
00459 for (inb = 1; inb <= i__4; ++inb) {
00460 nb = nbval[inb];
00461 xlaenv_(&c__1, &nb);
00462
00463
00464
00465
00466 i__5 = kd + 1;
00467 dlacpy_("Full", &i__5, &n, &a[1], &ldab, &afac[1], &
00468 ldab);
00469 s_copy(srnamc_1.srnamt, "DPBTRF", (ftnlen)32, (ftnlen)
00470 6);
00471 dpbtrf_(uplo, &n, &kd, &afac[1], &ldab, &info);
00472
00473
00474
00475 if (info != izero) {
00476 alaerh_(path, "DPBTRF", &info, &izero, uplo, &n, &
00477 n, &kd, &kd, &nb, &imat, &nfail, &nerrs,
00478 nout);
00479 goto L50;
00480 }
00481
00482
00483
00484 if (info != 0) {
00485 goto L50;
00486 }
00487
00488
00489
00490
00491
00492 i__5 = kd + 1;
00493 dlacpy_("Full", &i__5, &n, &afac[1], &ldab, &ainv[1],
00494 &ldab);
00495 dpbt01_(uplo, &n, &kd, &a[1], &ldab, &ainv[1], &ldab,
00496 &rwork[1], result);
00497
00498
00499
00500 if (result[0] >= *thresh) {
00501 if (nfail == 0 && nerrs == 0) {
00502 alahd_(nout, path);
00503 }
00504 io___40.ciunit = *nout;
00505 s_wsfe(&io___40);
00506 do_fio(&c__1, uplo, (ftnlen)1);
00507 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00508 ;
00509 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer)
00510 );
00511 do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(integer)
00512 );
00513 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00514 integer));
00515 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(
00516 integer));
00517 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(
00518 doublereal));
00519 e_wsfe();
00520 ++nfail;
00521 }
00522 ++nrun;
00523
00524
00525
00526 if (inb > 1) {
00527 goto L50;
00528 }
00529
00530
00531
00532
00533 dlaset_("Full", &n, &n, &c_b50, &c_b51, &ainv[1], &
00534 lda);
00535 s_copy(srnamc_1.srnamt, "DPBTRS", (ftnlen)32, (ftnlen)
00536 6);
00537 dpbtrs_(uplo, &n, &kd, &n, &afac[1], &ldab, &ainv[1],
00538 &lda, &info);
00539
00540
00541
00542 anorm = dlansb_("1", uplo, &n, &kd, &a[1], &ldab, &
00543 rwork[1]);
00544 ainvnm = dlange_("1", &n, &n, &ainv[1], &lda, &rwork[
00545 1]);
00546 if (anorm <= 0. || ainvnm <= 0.) {
00547 rcondc = 1.;
00548 } else {
00549 rcondc = 1. / anorm / ainvnm;
00550 }
00551
00552 i__5 = *nns;
00553 for (irhs = 1; irhs <= i__5; ++irhs) {
00554 nrhs = nsval[irhs];
00555
00556
00557
00558
00559 s_copy(srnamc_1.srnamt, "DLARHS", (ftnlen)32, (
00560 ftnlen)6);
00561 dlarhs_(path, xtype, uplo, " ", &n, &n, &kd, &kd,
00562 &nrhs, &a[1], &ldab, &xact[1], &lda, &b[1]
00563 , &lda, iseed, &info);
00564 dlacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &
00565 lda);
00566
00567 s_copy(srnamc_1.srnamt, "DPBTRS", (ftnlen)32, (
00568 ftnlen)6);
00569 dpbtrs_(uplo, &n, &kd, &nrhs, &afac[1], &ldab, &x[
00570 1], &lda, &info);
00571
00572
00573
00574 if (info != 0) {
00575 alaerh_(path, "DPBTRS", &info, &c__0, uplo, &
00576 n, &n, &kd, &kd, &nrhs, &imat, &nfail,
00577 &nerrs, nout);
00578 }
00579
00580 dlacpy_("Full", &n, &nrhs, &b[1], &lda, &work[1],
00581 &lda);
00582 dpbt02_(uplo, &n, &kd, &nrhs, &a[1], &ldab, &x[1],
00583 &lda, &work[1], &lda, &rwork[1], &result[
00584 1]);
00585
00586
00587
00588
00589 dget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00590 rcondc, &result[2]);
00591
00592
00593
00594
00595 s_copy(srnamc_1.srnamt, "DPBRFS", (ftnlen)32, (
00596 ftnlen)6);
00597 dpbrfs_(uplo, &n, &kd, &nrhs, &a[1], &ldab, &afac[
00598 1], &ldab, &b[1], &lda, &x[1], &lda, &
00599 rwork[1], &rwork[nrhs + 1], &work[1], &
00600 iwork[1], &info);
00601
00602
00603
00604 if (info != 0) {
00605 alaerh_(path, "DPBRFS", &info, &c__0, uplo, &
00606 n, &n, &kd, &kd, &nrhs, &imat, &nfail,
00607 &nerrs, nout);
00608 }
00609
00610 dget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00611 rcondc, &result[3]);
00612 dpbt05_(uplo, &n, &kd, &nrhs, &a[1], &ldab, &b[1],
00613 &lda, &x[1], &lda, &xact[1], &lda, &
00614 rwork[1], &rwork[nrhs + 1], &result[4]);
00615
00616
00617
00618
00619 for (k = 2; k <= 6; ++k) {
00620 if (result[k - 1] >= *thresh) {
00621 if (nfail == 0 && nerrs == 0) {
00622 alahd_(nout, path);
00623 }
00624 io___46.ciunit = *nout;
00625 s_wsfe(&io___46);
00626 do_fio(&c__1, uplo, (ftnlen)1);
00627 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00628 integer));
00629 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(
00630 integer));
00631 do_fio(&c__1, (char *)&nrhs, (ftnlen)
00632 sizeof(integer));
00633 do_fio(&c__1, (char *)&imat, (ftnlen)
00634 sizeof(integer));
00635 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00636 integer));
00637 do_fio(&c__1, (char *)&result[k - 1], (
00638 ftnlen)sizeof(doublereal));
00639 e_wsfe();
00640 ++nfail;
00641 }
00642
00643 }
00644 nrun += 5;
00645
00646 }
00647
00648
00649
00650
00651 s_copy(srnamc_1.srnamt, "DPBCON", (ftnlen)32, (ftnlen)
00652 6);
00653 dpbcon_(uplo, &n, &kd, &afac[1], &ldab, &anorm, &
00654 rcond, &work[1], &iwork[1], &info);
00655
00656
00657
00658 if (info != 0) {
00659 alaerh_(path, "DPBCON", &info, &c__0, uplo, &n, &
00660 n, &kd, &kd, &c_n1, &imat, &nfail, &nerrs,
00661 nout);
00662 }
00663
00664 result[6] = dget06_(&rcond, &rcondc);
00665
00666
00667
00668 if (result[6] >= *thresh) {
00669 if (nfail == 0 && nerrs == 0) {
00670 alahd_(nout, path);
00671 }
00672 io___48.ciunit = *nout;
00673 s_wsfe(&io___48);
00674 do_fio(&c__1, uplo, (ftnlen)1);
00675 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00676 ;
00677 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer)
00678 );
00679 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00680 integer));
00681 do_fio(&c__1, (char *)&c__7, (ftnlen)sizeof(
00682 integer));
00683 do_fio(&c__1, (char *)&result[6], (ftnlen)sizeof(
00684 doublereal));
00685 e_wsfe();
00686 ++nfail;
00687 }
00688 ++nrun;
00689 L50:
00690 ;
00691 }
00692 L60:
00693 ;
00694 }
00695
00696 }
00697
00698 }
00699
00700 }
00701
00702
00703
00704 alasum_(path, nout, &nfail, &nrun, &nerrs);
00705
00706 return 0;
00707
00708
00709
00710 }