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