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__2 = 2;
00036 static integer c__1 = 1;
00037 static doublecomplex c_b63 = {0.,0.};
00038
00039 int zdrvpp_(logical *dotype, integer *nn, integer *nval,
00040 integer *nrhs, doublereal *thresh, logical *tsterr, integer *nmax,
00041 doublecomplex *a, doublecomplex *afac, doublecomplex *asav,
00042 doublecomplex *b, doublecomplex *bsav, doublecomplex *x,
00043 doublecomplex *xact, doublereal *s, doublecomplex *work, doublereal *
00044 rwork, integer *nout)
00045 {
00046
00047
00048 static integer iseedy[4] = { 1988,1989,1990,1991 };
00049 static char uplos[1*2] = "U" "L";
00050 static char facts[1*3] = "F" "N" "E";
00051 static char packs[1*2] = "C" "R";
00052 static char equeds[1*2] = "N" "Y";
00053
00054
00055 static char fmt_9999[] = "(1x,a,\002, UPLO='\002,a1,\002', N =\002,i5"
00056 ",\002, type \002,i1,\002, test(\002,i1,\002)=\002,g12.5)";
00057 static char fmt_9997[] = "(1x,a,\002, FACT='\002,a1,\002', UPLO='\002,"
00058 "a1,\002', N=\002,i5,\002, EQUED='\002,a1,\002', type \002,i1,"
00059 "\002, test(\002,i1,\002)=\002,g12.5)";
00060 static char fmt_9998[] = "(1x,a,\002, FACT='\002,a1,\002', UPLO='\002,"
00061 "a1,\002', N=\002,i5,\002, type \002,i1,\002, test(\002,i1,\002)"
00062 "=\002,g12.5)";
00063
00064
00065 address a__1[2];
00066 integer i__1, i__2, i__3, i__4, i__5[2];
00067 char ch__1[2];
00068
00069
00070 int s_copy(char *, char *, ftnlen, ftnlen);
00071 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00072 int s_cat(char *, char **, integer *, integer *, ftnlen);
00073
00074
00075 integer i__, k, n, k1, in, kl, ku, nt, lda, npp;
00076 char fact[1];
00077 integer ioff, mode;
00078 doublereal amax;
00079 char path[3];
00080 integer imat, info;
00081 char dist[1], uplo[1], type__[1];
00082 integer nrun, ifact, nfail, iseed[4], nfact;
00083 extern doublereal dget06_(doublereal *, doublereal *);
00084 extern logical lsame_(char *, char *);
00085 char equed[1];
00086 doublereal roldc, rcond, scond;
00087 integer nimat;
00088 doublereal anorm;
00089 extern int zget04_(integer *, integer *, doublecomplex *,
00090 integer *, doublecomplex *, integer *, doublereal *, doublereal *
00091 );
00092 logical equil;
00093 integer iuplo, izero, nerrs;
00094 extern int zppt01_(char *, integer *, doublecomplex *,
00095 doublecomplex *, doublereal *, doublereal *), zppt02_(
00096 char *, integer *, integer *, doublecomplex *, doublecomplex *,
00097 integer *, doublecomplex *, integer *, doublereal *, doublereal *);
00098 logical zerot;
00099 extern int zcopy_(integer *, doublecomplex *, integer *,
00100 doublecomplex *, integer *), zppt05_(char *, integer *, integer *,
00101 doublecomplex *, doublecomplex *, integer *, doublecomplex *,
00102 integer *, doublecomplex *, integer *, doublereal *, doublereal *,
00103 doublereal *);
00104 char xtype[1];
00105 extern int zppsv_(char *, integer *, integer *,
00106 doublecomplex *, doublecomplex *, integer *, integer *),
00107 zlatb4_(char *, integer *, integer *, integer *, char *, integer *
00108 , integer *, doublereal *, integer *, doublereal *, char *), aladhd_(integer *, char *),
00109 alaerh_(char *, char *, integer *, integer *, char *, integer *,
00110 integer *, integer *, integer *, integer *, integer *, integer *,
00111 integer *, integer *);
00112 logical prefac;
00113 doublereal rcondc;
00114 logical nofact;
00115 char packit[1];
00116 integer iequed;
00117 extern int alasvm_(char *, integer *, integer *, integer
00118 *, integer *);
00119 doublereal cndnum;
00120 extern int zlaipd_(integer *, doublecomplex *, integer *,
00121 integer *);
00122 doublereal ainvnm;
00123 extern doublereal zlanhp_(char *, char *, integer *, doublecomplex *,
00124 doublereal *);
00125 extern int zlaqhp_(char *, integer *, doublecomplex *,
00126 doublereal *, doublereal *, doublereal *, char *),
00127 zlacpy_(char *, integer *, integer *, doublecomplex *, integer *,
00128 doublecomplex *, integer *), zlarhs_(char *, char *,
00129 char *, char *, integer *, integer *, integer *, integer *,
00130 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00131 doublecomplex *, integer *, integer *, integer *), zlaset_(char *, integer *, integer *,
00132 doublecomplex *, doublecomplex *, doublecomplex *, integer *), zlatms_(integer *, integer *, char *, integer *, char *,
00133 doublereal *, integer *, doublereal *, doublereal *, integer *,
00134 integer *, char *, doublecomplex *, integer *, doublecomplex *,
00135 integer *);
00136 doublereal result[6];
00137 extern int zppequ_(char *, integer *, doublecomplex *,
00138 doublereal *, doublereal *, doublereal *, integer *),
00139 zpptrf_(char *, integer *, doublecomplex *, integer *),
00140 zpptri_(char *, integer *, doublecomplex *, integer *),
00141 zerrvx_(char *, integer *), zppsvx_(char *, char *,
00142 integer *, integer *, doublecomplex *, doublecomplex *, char *,
00143 doublereal *, doublecomplex *, integer *, doublecomplex *,
00144 integer *, doublereal *, doublereal *, doublereal *,
00145 doublecomplex *, doublereal *, integer *);
00146
00147
00148 static cilist io___49 = { 0, 0, 0, fmt_9999, 0 };
00149 static cilist io___52 = { 0, 0, 0, fmt_9997, 0 };
00150 static cilist io___53 = { 0, 0, 0, fmt_9998, 0 };
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 --rwork;
00243 --work;
00244 --s;
00245 --xact;
00246 --x;
00247 --bsav;
00248 --b;
00249 --asav;
00250 --afac;
00251 --a;
00252 --nval;
00253 --dotype;
00254
00255
00256
00257
00258
00259
00260
00261 s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00262 s_copy(path + 1, "PP", (ftnlen)2, (ftnlen)2);
00263 nrun = 0;
00264 nfail = 0;
00265 nerrs = 0;
00266 for (i__ = 1; i__ <= 4; ++i__) {
00267 iseed[i__ - 1] = iseedy[i__ - 1];
00268
00269 }
00270
00271
00272
00273 if (*tsterr) {
00274 zerrvx_(path, nout);
00275 }
00276 infoc_1.infot = 0;
00277
00278
00279
00280 i__1 = *nn;
00281 for (in = 1; in <= i__1; ++in) {
00282 n = nval[in];
00283 lda = max(n,1);
00284 npp = n * (n + 1) / 2;
00285 *(unsigned char *)xtype = 'N';
00286 nimat = 9;
00287 if (n <= 0) {
00288 nimat = 1;
00289 }
00290
00291 i__2 = nimat;
00292 for (imat = 1; imat <= i__2; ++imat) {
00293
00294
00295
00296 if (! dotype[imat]) {
00297 goto L130;
00298 }
00299
00300
00301
00302 zerot = imat >= 3 && imat <= 5;
00303 if (zerot && n < imat - 2) {
00304 goto L130;
00305 }
00306
00307
00308
00309 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00310 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00311 *(unsigned char *)packit = *(unsigned char *)&packs[iuplo - 1]
00312 ;
00313
00314
00315
00316
00317 zlatb4_(path, &imat, &n, &n, type__, &kl, &ku, &anorm, &mode,
00318 &cndnum, dist);
00319 rcondc = 1. / cndnum;
00320
00321 s_copy(srnamc_1.srnamt, "ZLATMS", (ftnlen)32, (ftnlen)6);
00322 zlatms_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00323 cndnum, &anorm, &kl, &ku, packit, &a[1], &lda, &work[
00324 1], &info);
00325
00326
00327
00328 if (info != 0) {
00329 alaerh_(path, "ZLATMS", &info, &c__0, uplo, &n, &n, &c_n1,
00330 &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00331 goto L120;
00332 }
00333
00334
00335
00336
00337 if (zerot) {
00338 if (imat == 3) {
00339 izero = 1;
00340 } else if (imat == 4) {
00341 izero = n;
00342 } else {
00343 izero = n / 2 + 1;
00344 }
00345
00346
00347
00348 if (iuplo == 1) {
00349 ioff = (izero - 1) * izero / 2;
00350 i__3 = izero - 1;
00351 for (i__ = 1; i__ <= i__3; ++i__) {
00352 i__4 = ioff + i__;
00353 a[i__4].r = 0., a[i__4].i = 0.;
00354
00355 }
00356 ioff += izero;
00357 i__3 = n;
00358 for (i__ = izero; i__ <= i__3; ++i__) {
00359 i__4 = ioff;
00360 a[i__4].r = 0., a[i__4].i = 0.;
00361 ioff += i__;
00362
00363 }
00364 } else {
00365 ioff = izero;
00366 i__3 = izero - 1;
00367 for (i__ = 1; i__ <= i__3; ++i__) {
00368 i__4 = ioff;
00369 a[i__4].r = 0., a[i__4].i = 0.;
00370 ioff = ioff + n - i__;
00371
00372 }
00373 ioff -= izero;
00374 i__3 = n;
00375 for (i__ = izero; i__ <= i__3; ++i__) {
00376 i__4 = ioff + i__;
00377 a[i__4].r = 0., a[i__4].i = 0.;
00378
00379 }
00380 }
00381 } else {
00382 izero = 0;
00383 }
00384
00385
00386
00387 if (iuplo == 1) {
00388 zlaipd_(&n, &a[1], &c__2, &c__1);
00389 } else {
00390 zlaipd_(&n, &a[1], &n, &c_n1);
00391 }
00392
00393
00394
00395 zcopy_(&npp, &a[1], &c__1, &asav[1], &c__1);
00396
00397 for (iequed = 1; iequed <= 2; ++iequed) {
00398 *(unsigned char *)equed = *(unsigned char *)&equeds[
00399 iequed - 1];
00400 if (iequed == 1) {
00401 nfact = 3;
00402 } else {
00403 nfact = 1;
00404 }
00405
00406 i__3 = nfact;
00407 for (ifact = 1; ifact <= i__3; ++ifact) {
00408 *(unsigned char *)fact = *(unsigned char *)&facts[
00409 ifact - 1];
00410 prefac = lsame_(fact, "F");
00411 nofact = lsame_(fact, "N");
00412 equil = lsame_(fact, "E");
00413
00414 if (zerot) {
00415 if (prefac) {
00416 goto L100;
00417 }
00418 rcondc = 0.;
00419
00420 } else if (! lsame_(fact, "N"))
00421 {
00422
00423
00424
00425
00426
00427
00428 zcopy_(&npp, &asav[1], &c__1, &afac[1], &c__1);
00429 if (equil || iequed > 1) {
00430
00431
00432
00433
00434 zppequ_(uplo, &n, &afac[1], &s[1], &scond, &
00435 amax, &info);
00436 if (info == 0 && n > 0) {
00437 if (iequed > 1) {
00438 scond = 0.;
00439 }
00440
00441
00442
00443 zlaqhp_(uplo, &n, &afac[1], &s[1], &scond,
00444 &amax, equed);
00445 }
00446 }
00447
00448
00449
00450
00451 if (equil) {
00452 roldc = rcondc;
00453 }
00454
00455
00456
00457 anorm = zlanhp_("1", uplo, &n, &afac[1], &rwork[1]
00458 );
00459
00460
00461
00462 zpptrf_(uplo, &n, &afac[1], &info);
00463
00464
00465
00466 zcopy_(&npp, &afac[1], &c__1, &a[1], &c__1);
00467 zpptri_(uplo, &n, &a[1], &info);
00468
00469
00470
00471 ainvnm = zlanhp_("1", uplo, &n, &a[1], &rwork[1]);
00472 if (anorm <= 0. || ainvnm <= 0.) {
00473 rcondc = 1.;
00474 } else {
00475 rcondc = 1. / anorm / ainvnm;
00476 }
00477 }
00478
00479
00480
00481 zcopy_(&npp, &asav[1], &c__1, &a[1], &c__1);
00482
00483
00484
00485 s_copy(srnamc_1.srnamt, "ZLARHS", (ftnlen)32, (ftnlen)
00486 6);
00487 zlarhs_(path, xtype, uplo, " ", &n, &n, &kl, &ku,
00488 nrhs, &a[1], &lda, &xact[1], &lda, &b[1], &
00489 lda, iseed, &info);
00490 *(unsigned char *)xtype = 'C';
00491 zlacpy_("Full", &n, nrhs, &b[1], &lda, &bsav[1], &lda);
00492
00493 if (nofact) {
00494
00495
00496
00497
00498
00499
00500 zcopy_(&npp, &a[1], &c__1, &afac[1], &c__1);
00501 zlacpy_("Full", &n, nrhs, &b[1], &lda, &x[1], &
00502 lda);
00503
00504 s_copy(srnamc_1.srnamt, "ZPPSV ", (ftnlen)32, (
00505 ftnlen)6);
00506 zppsv_(uplo, &n, nrhs, &afac[1], &x[1], &lda, &
00507 info);
00508
00509
00510
00511 if (info != izero) {
00512 alaerh_(path, "ZPPSV ", &info, &izero, uplo, &
00513 n, &n, &c_n1, &c_n1, nrhs, &imat, &
00514 nfail, &nerrs, nout);
00515 goto L70;
00516 } else if (info != 0) {
00517 goto L70;
00518 }
00519
00520
00521
00522
00523 zppt01_(uplo, &n, &a[1], &afac[1], &rwork[1],
00524 result);
00525
00526
00527
00528 zlacpy_("Full", &n, nrhs, &b[1], &lda, &work[1], &
00529 lda);
00530 zppt02_(uplo, &n, nrhs, &a[1], &x[1], &lda, &work[
00531 1], &lda, &rwork[1], &result[1]);
00532
00533
00534
00535 zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda, &
00536 rcondc, &result[2]);
00537 nt = 3;
00538
00539
00540
00541
00542 i__4 = nt;
00543 for (k = 1; k <= i__4; ++k) {
00544 if (result[k - 1] >= *thresh) {
00545 if (nfail == 0 && nerrs == 0) {
00546 aladhd_(nout, path);
00547 }
00548 io___49.ciunit = *nout;
00549 s_wsfe(&io___49);
00550 do_fio(&c__1, "ZPPSV ", (ftnlen)6);
00551 do_fio(&c__1, uplo, (ftnlen)1);
00552 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00553 integer));
00554 do_fio(&c__1, (char *)&imat, (ftnlen)
00555 sizeof(integer));
00556 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00557 integer));
00558 do_fio(&c__1, (char *)&result[k - 1], (
00559 ftnlen)sizeof(doublereal));
00560 e_wsfe();
00561 ++nfail;
00562 }
00563
00564 }
00565 nrun += nt;
00566 L70:
00567 ;
00568 }
00569
00570
00571
00572 if (! prefac && npp > 0) {
00573 zlaset_("Full", &npp, &c__1, &c_b63, &c_b63, &
00574 afac[1], &npp);
00575 }
00576 zlaset_("Full", &n, nrhs, &c_b63, &c_b63, &x[1], &lda);
00577 if (iequed > 1 && n > 0) {
00578
00579
00580
00581
00582 zlaqhp_(uplo, &n, &a[1], &s[1], &scond, &amax,
00583 equed);
00584 }
00585
00586
00587
00588
00589 s_copy(srnamc_1.srnamt, "ZPPSVX", (ftnlen)32, (ftnlen)
00590 6);
00591 zppsvx_(fact, uplo, &n, nrhs, &a[1], &afac[1], equed,
00592 &s[1], &b[1], &lda, &x[1], &lda, &rcond, &
00593 rwork[1], &rwork[*nrhs + 1], &work[1], &rwork[
00594 (*nrhs << 1) + 1], &info);
00595
00596
00597
00598 if (info != izero) {
00599
00600 i__5[0] = 1, a__1[0] = fact;
00601 i__5[1] = 1, a__1[1] = uplo;
00602 s_cat(ch__1, a__1, i__5, &c__2, (ftnlen)2);
00603 alaerh_(path, "ZPPSVX", &info, &izero, ch__1, &n,
00604 &n, &c_n1, &c_n1, nrhs, &imat, &nfail, &
00605 nerrs, nout);
00606 goto L90;
00607 }
00608
00609 if (info == 0) {
00610 if (! prefac) {
00611
00612
00613
00614
00615 zppt01_(uplo, &n, &a[1], &afac[1], &rwork[(*
00616 nrhs << 1) + 1], result);
00617 k1 = 1;
00618 } else {
00619 k1 = 2;
00620 }
00621
00622
00623
00624 zlacpy_("Full", &n, nrhs, &bsav[1], &lda, &work[1]
00625 , &lda);
00626 zppt02_(uplo, &n, nrhs, &asav[1], &x[1], &lda, &
00627 work[1], &lda, &rwork[(*nrhs << 1) + 1], &
00628 result[1]);
00629
00630
00631
00632 if (nofact || prefac && lsame_(equed, "N")) {
00633 zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda,
00634 &rcondc, &result[2]);
00635 } else {
00636 zget04_(&n, nrhs, &x[1], &lda, &xact[1], &lda,
00637 &roldc, &result[2]);
00638 }
00639
00640
00641
00642
00643 zppt05_(uplo, &n, nrhs, &asav[1], &b[1], &lda, &x[
00644 1], &lda, &xact[1], &lda, &rwork[1], &
00645 rwork[*nrhs + 1], &result[3]);
00646 } else {
00647 k1 = 6;
00648 }
00649
00650
00651
00652
00653 result[5] = dget06_(&rcond, &rcondc);
00654
00655
00656
00657
00658 for (k = k1; k <= 6; ++k) {
00659 if (result[k - 1] >= *thresh) {
00660 if (nfail == 0 && nerrs == 0) {
00661 aladhd_(nout, path);
00662 }
00663 if (prefac) {
00664 io___52.ciunit = *nout;
00665 s_wsfe(&io___52);
00666 do_fio(&c__1, "ZPPSVX", (ftnlen)6);
00667 do_fio(&c__1, fact, (ftnlen)1);
00668 do_fio(&c__1, uplo, (ftnlen)1);
00669 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00670 integer));
00671 do_fio(&c__1, equed, (ftnlen)1);
00672 do_fio(&c__1, (char *)&imat, (ftnlen)
00673 sizeof(integer));
00674 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00675 integer));
00676 do_fio(&c__1, (char *)&result[k - 1], (
00677 ftnlen)sizeof(doublereal));
00678 e_wsfe();
00679 } else {
00680 io___53.ciunit = *nout;
00681 s_wsfe(&io___53);
00682 do_fio(&c__1, "ZPPSVX", (ftnlen)6);
00683 do_fio(&c__1, fact, (ftnlen)1);
00684 do_fio(&c__1, uplo, (ftnlen)1);
00685 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00686 integer));
00687 do_fio(&c__1, (char *)&imat, (ftnlen)
00688 sizeof(integer));
00689 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00690 integer));
00691 do_fio(&c__1, (char *)&result[k - 1], (
00692 ftnlen)sizeof(doublereal));
00693 e_wsfe();
00694 }
00695 ++nfail;
00696 }
00697
00698 }
00699 nrun = nrun + 7 - k1;
00700 L90:
00701 L100:
00702 ;
00703 }
00704
00705 }
00706 L120:
00707 ;
00708 }
00709 L130:
00710 ;
00711 }
00712
00713 }
00714
00715
00716
00717 alasvm_(path, nout, &nfail, &nrun, &nerrs);
00718
00719 return 0;
00720
00721
00722
00723 }