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