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 integer c__8 = 8;
00038
00039 int dchkpo_(logical *dotype, integer *nn, integer *nval,
00040 integer *nnb, integer *nbval, integer *nns, integer *nsval,
00041 doublereal *thresh, logical *tsterr, integer *nmax, doublereal *a,
00042 doublereal *afac, doublereal *ainv, doublereal *b, doublereal *x,
00043 doublereal *xact, doublereal *work, doublereal *rwork, integer *iwork,
00044 integer *nout)
00045 {
00046
00047
00048 static integer iseedy[4] = { 1988,1989,1990,1991 };
00049 static char uplos[1*2] = "U" "L";
00050
00051
00052 static char fmt_9999[] = "(\002 UPLO = '\002,a1,\002', N =\002,i5,\002, "
00053 "NB =\002,i4,\002, type \002,i2,\002, test \002,i2,\002, ratio "
00054 "=\002,g12.5)";
00055 static char fmt_9998[] = "(\002 UPLO = '\002,a1,\002', N =\002,i5,\002, "
00056 "NRHS=\002,i3,\002, type \002,i2,\002, test(\002,i2,\002) =\002,g"
00057 "12.5)";
00058 static char fmt_9997[] = "(\002 UPLO = '\002,a1,\002', N =\002,i5,\002"
00059 ",\002,10x,\002 type \002,i2,\002, test(\002,i2,\002) =\002,g12.5)"
00060 ;
00061
00062
00063 integer i__1, i__2, i__3, i__4;
00064
00065
00066 int s_copy(char *, char *, ftnlen, ftnlen);
00067 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00068
00069
00070 integer i__, k, n, nb, in, kl, ku, lda, inb, ioff, mode, imat, info;
00071 char path[3], dist[1];
00072 integer irhs, nrhs;
00073 char uplo[1], type__[1];
00074 integer nrun;
00075 extern int alahd_(integer *, char *), dget04_(
00076 integer *, integer *, doublereal *, integer *, doublereal *,
00077 integer *, doublereal *, doublereal *);
00078 integer nfail, iseed[4];
00079 extern doublereal dget06_(doublereal *, doublereal *);
00080 doublereal rcond;
00081 extern int dpot01_(char *, integer *, doublereal *,
00082 integer *, doublereal *, integer *, doublereal *, doublereal *);
00083 integer nimat;
00084 extern int dpot02_(char *, integer *, integer *,
00085 doublereal *, integer *, doublereal *, integer *, doublereal *,
00086 integer *, doublereal *, doublereal *), dpot03_(char *,
00087 integer *, doublereal *, integer *, doublereal *, integer *,
00088 doublereal *, integer *, doublereal *, doublereal *, doublereal *), dpot05_(char *, integer *, integer *, doublereal *,
00089 integer *, doublereal *, integer *, doublereal *, integer *,
00090 doublereal *, integer *, doublereal *, doublereal *, doublereal *);
00091 doublereal anorm;
00092 integer iuplo, izero, nerrs;
00093 logical zerot;
00094 char xtype[1];
00095 extern int dlatb4_(char *, integer *, integer *, integer
00096 *, char *, integer *, integer *, doublereal *, integer *,
00097 doublereal *, char *), alaerh_(char *,
00098 char *, integer *, integer *, char *, integer *, integer *,
00099 integer *, integer *, integer *, integer *, integer *, integer *,
00100 integer *);
00101 doublereal rcondc;
00102 extern int dlacpy_(char *, integer *, integer *,
00103 doublereal *, integer *, doublereal *, integer *),
00104 dlarhs_(char *, char *, char *, char *, integer *, integer *,
00105 integer *, integer *, integer *, doublereal *, integer *,
00106 doublereal *, integer *, doublereal *, integer *, integer *,
00107 integer *), alasum_(char *,
00108 integer *, integer *, integer *, integer *);
00109 doublereal cndnum;
00110 extern int dlatms_(integer *, integer *, char *, integer
00111 *, char *, doublereal *, integer *, doublereal *, doublereal *,
00112 integer *, integer *, char *, doublereal *, integer *, doublereal
00113 *, integer *), dpocon_(char *, integer *,
00114 doublereal *, integer *, doublereal *, doublereal *, doublereal *,
00115 integer *, integer *);
00116 extern doublereal dlansy_(char *, char *, integer *, doublereal *,
00117 integer *, doublereal *);
00118 extern int derrpo_(char *, integer *), dporfs_(
00119 char *, integer *, integer *, doublereal *, integer *, doublereal
00120 *, integer *, doublereal *, integer *, doublereal *, integer *,
00121 doublereal *, doublereal *, doublereal *, integer *, integer *), dpotrf_(char *, integer *, doublereal *, integer *,
00122 integer *), xlaenv_(integer *, integer *), dpotri_(char *,
00123 integer *, doublereal *, integer *, integer *), dpotrs_(
00124 char *, integer *, integer *, doublereal *, integer *, doublereal
00125 *, integer *, integer *);
00126 doublereal result[8];
00127
00128
00129 static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
00130 static cilist io___36 = { 0, 0, 0, fmt_9998, 0 };
00131 static cilist io___38 = { 0, 0, 0, fmt_9997, 0 };
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
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 --iwork;
00232 --rwork;
00233 --work;
00234 --xact;
00235 --x;
00236 --b;
00237 --ainv;
00238 --afac;
00239 --a;
00240 --nsval;
00241 --nbval;
00242 --nval;
00243 --dotype;
00244
00245
00246
00247
00248
00249
00250
00251 s_copy(path, "Double precision", (ftnlen)1, (ftnlen)16);
00252 s_copy(path + 1, "PO", (ftnlen)2, (ftnlen)2);
00253 nrun = 0;
00254 nfail = 0;
00255 nerrs = 0;
00256 for (i__ = 1; i__ <= 4; ++i__) {
00257 iseed[i__ - 1] = iseedy[i__ - 1];
00258
00259 }
00260
00261
00262
00263 if (*tsterr) {
00264 derrpo_(path, nout);
00265 }
00266 infoc_1.infot = 0;
00267 xlaenv_(&c__2, &c__2);
00268
00269
00270
00271 i__1 = *nn;
00272 for (in = 1; in <= i__1; ++in) {
00273 n = nval[in];
00274 lda = max(n,1);
00275 *(unsigned char *)xtype = 'N';
00276 nimat = 9;
00277 if (n <= 0) {
00278 nimat = 1;
00279 }
00280
00281 izero = 0;
00282 i__2 = nimat;
00283 for (imat = 1; imat <= i__2; ++imat) {
00284
00285
00286
00287 if (! dotype[imat]) {
00288 goto L110;
00289 }
00290
00291
00292
00293 zerot = imat >= 3 && imat <= 5;
00294 if (zerot && n < imat - 2) {
00295 goto L110;
00296 }
00297
00298
00299
00300 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00301 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00302
00303
00304
00305
00306 dlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &mode,
00307 &cndnum, dist);
00308
00309 s_copy(srnamc_1.srnamt, "DLATMS", (ftnlen)32, (ftnlen)6);
00310 dlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00311 cndnum, &anorm, &kl, &ku, uplo, &a[1], &lda, &work[1],
00312 &info);
00313
00314
00315
00316 if (info != 0) {
00317 alaerh_(path, "DLATMS", &info, &c__0, uplo, &n, &n, &c_n1,
00318 &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00319 goto L100;
00320 }
00321
00322
00323
00324
00325 if (zerot) {
00326 if (imat == 3) {
00327 izero = 1;
00328 } else if (imat == 4) {
00329 izero = n;
00330 } else {
00331 izero = n / 2 + 1;
00332 }
00333 ioff = (izero - 1) * lda;
00334
00335
00336
00337 if (iuplo == 1) {
00338 i__3 = izero - 1;
00339 for (i__ = 1; i__ <= i__3; ++i__) {
00340 a[ioff + i__] = 0.;
00341
00342 }
00343 ioff += izero;
00344 i__3 = n;
00345 for (i__ = izero; i__ <= i__3; ++i__) {
00346 a[ioff] = 0.;
00347 ioff += lda;
00348
00349 }
00350 } else {
00351 ioff = izero;
00352 i__3 = izero - 1;
00353 for (i__ = 1; i__ <= i__3; ++i__) {
00354 a[ioff] = 0.;
00355 ioff += lda;
00356
00357 }
00358 ioff -= izero;
00359 i__3 = n;
00360 for (i__ = izero; i__ <= i__3; ++i__) {
00361 a[ioff + i__] = 0.;
00362
00363 }
00364 }
00365 } else {
00366 izero = 0;
00367 }
00368
00369
00370
00371 i__3 = *nnb;
00372 for (inb = 1; inb <= i__3; ++inb) {
00373 nb = nbval[inb];
00374 xlaenv_(&c__1, &nb);
00375
00376
00377
00378 dlacpy_(uplo, &n, &n, &a[1], &lda, &afac[1], &lda);
00379 s_copy(srnamc_1.srnamt, "DPOTRF", (ftnlen)32, (ftnlen)6);
00380 dpotrf_(uplo, &n, &afac[1], &lda, &info);
00381
00382
00383
00384 if (info != izero) {
00385 alaerh_(path, "DPOTRF", &info, &izero, uplo, &n, &n, &
00386 c_n1, &c_n1, &nb, &imat, &nfail, &nerrs, nout);
00387 goto L90;
00388 }
00389
00390
00391
00392 if (info != 0) {
00393 goto L90;
00394 }
00395
00396
00397
00398
00399 dlacpy_(uplo, &n, &n, &afac[1], &lda, &ainv[1], &lda);
00400 dpot01_(uplo, &n, &a[1], &lda, &ainv[1], &lda, &rwork[1],
00401 result);
00402
00403
00404
00405
00406 dlacpy_(uplo, &n, &n, &afac[1], &lda, &ainv[1], &lda);
00407 s_copy(srnamc_1.srnamt, "DPOTRI", (ftnlen)32, (ftnlen)6);
00408 dpotri_(uplo, &n, &ainv[1], &lda, &info);
00409
00410
00411
00412 if (info != 0) {
00413 alaerh_(path, "DPOTRI", &info, &c__0, uplo, &n, &n, &
00414 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00415 nout);
00416 }
00417
00418 dpot03_(uplo, &n, &a[1], &lda, &ainv[1], &lda, &work[1], &
00419 lda, &rwork[1], &rcondc, &result[1]);
00420
00421
00422
00423
00424 for (k = 1; k <= 2; ++k) {
00425 if (result[k - 1] >= *thresh) {
00426 if (nfail == 0 && nerrs == 0) {
00427 alahd_(nout, path);
00428 }
00429 io___33.ciunit = *nout;
00430 s_wsfe(&io___33);
00431 do_fio(&c__1, uplo, (ftnlen)1);
00432 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00433 ;
00434 do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(integer)
00435 );
00436 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00437 integer));
00438 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer))
00439 ;
00440 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00441 sizeof(doublereal));
00442 e_wsfe();
00443 ++nfail;
00444 }
00445
00446 }
00447 nrun += 2;
00448
00449
00450
00451
00452 if (inb != 1) {
00453 goto L90;
00454 }
00455
00456 i__4 = *nns;
00457 for (irhs = 1; irhs <= i__4; ++irhs) {
00458 nrhs = nsval[irhs];
00459
00460
00461
00462
00463 s_copy(srnamc_1.srnamt, "DLARHS", (ftnlen)32, (ftnlen)
00464 6);
00465 dlarhs_(path, xtype, uplo, " ", &n, &n, &kl, &ku, &
00466 nrhs, &a[1], &lda, &xact[1], &lda, &b[1], &
00467 lda, iseed, &info);
00468 dlacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &lda);
00469
00470 s_copy(srnamc_1.srnamt, "DPOTRS", (ftnlen)32, (ftnlen)
00471 6);
00472 dpotrs_(uplo, &n, &nrhs, &afac[1], &lda, &x[1], &lda,
00473 &info);
00474
00475
00476
00477 if (info != 0) {
00478 alaerh_(path, "DPOTRS", &info, &c__0, uplo, &n, &
00479 n, &c_n1, &c_n1, &nrhs, &imat, &nfail, &
00480 nerrs, nout);
00481 }
00482
00483 dlacpy_("Full", &n, &nrhs, &b[1], &lda, &work[1], &
00484 lda);
00485 dpot02_(uplo, &n, &nrhs, &a[1], &lda, &x[1], &lda, &
00486 work[1], &lda, &rwork[1], &result[2]);
00487
00488
00489
00490
00491 dget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00492 rcondc, &result[3]);
00493
00494
00495
00496
00497 s_copy(srnamc_1.srnamt, "DPORFS", (ftnlen)32, (ftnlen)
00498 6);
00499 dporfs_(uplo, &n, &nrhs, &a[1], &lda, &afac[1], &lda,
00500 &b[1], &lda, &x[1], &lda, &rwork[1], &rwork[
00501 nrhs + 1], &work[1], &iwork[1], &info);
00502
00503
00504
00505 if (info != 0) {
00506 alaerh_(path, "DPORFS", &info, &c__0, uplo, &n, &
00507 n, &c_n1, &c_n1, &nrhs, &imat, &nfail, &
00508 nerrs, nout);
00509 }
00510
00511 dget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00512 rcondc, &result[4]);
00513 dpot05_(uplo, &n, &nrhs, &a[1], &lda, &b[1], &lda, &x[
00514 1], &lda, &xact[1], &lda, &rwork[1], &rwork[
00515 nrhs + 1], &result[5]);
00516
00517
00518
00519
00520 for (k = 3; k <= 7; ++k) {
00521 if (result[k - 1] >= *thresh) {
00522 if (nfail == 0 && nerrs == 0) {
00523 alahd_(nout, path);
00524 }
00525 io___36.ciunit = *nout;
00526 s_wsfe(&io___36);
00527 do_fio(&c__1, uplo, (ftnlen)1);
00528 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00529 integer));
00530 do_fio(&c__1, (char *)&nrhs, (ftnlen)sizeof(
00531 integer));
00532 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00533 integer));
00534 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00535 integer));
00536 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00537 sizeof(doublereal));
00538 e_wsfe();
00539 ++nfail;
00540 }
00541
00542 }
00543 nrun += 5;
00544
00545 }
00546
00547
00548
00549
00550 anorm = dlansy_("1", uplo, &n, &a[1], &lda, &rwork[1]);
00551 s_copy(srnamc_1.srnamt, "DPOCON", (ftnlen)32, (ftnlen)6);
00552 dpocon_(uplo, &n, &afac[1], &lda, &anorm, &rcond, &work[1]
00553 , &iwork[1], &info);
00554
00555
00556
00557 if (info != 0) {
00558 alaerh_(path, "DPOCON", &info, &c__0, uplo, &n, &n, &
00559 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00560 nout);
00561 }
00562
00563 result[7] = dget06_(&rcond, &rcondc);
00564
00565
00566
00567 if (result[7] >= *thresh) {
00568 if (nfail == 0 && nerrs == 0) {
00569 alahd_(nout, path);
00570 }
00571 io___38.ciunit = *nout;
00572 s_wsfe(&io___38);
00573 do_fio(&c__1, uplo, (ftnlen)1);
00574 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00575 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00576 do_fio(&c__1, (char *)&c__8, (ftnlen)sizeof(integer));
00577 do_fio(&c__1, (char *)&result[7], (ftnlen)sizeof(
00578 doublereal));
00579 e_wsfe();
00580 ++nfail;
00581 }
00582 ++nrun;
00583 L90:
00584 ;
00585 }
00586 L100:
00587 ;
00588 }
00589 L110:
00590 ;
00591 }
00592
00593 }
00594
00595
00596
00597 alasum_(path, nout, &nfail, &nrun, &nerrs);
00598
00599 return 0;
00600
00601
00602
00603 }