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