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