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, iounit;
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__1 = 1;
00034 static integer c__0 = 0;
00035 static integer c_n1 = -1;
00036 static integer c__2 = 2;
00037 static integer c__3 = 3;
00038 static integer c__7 = 7;
00039 static integer c__4 = 4;
00040 static doublereal c_b103 = 1.;
00041 static integer c__8 = 8;
00042 static integer c__9 = 9;
00043
00044 int zchktp_(logical *dotype, integer *nn, integer *nval,
00045 integer *nns, integer *nsval, doublereal *thresh, logical *tsterr,
00046 integer *nmax, doublecomplex *ap, doublecomplex *ainvp, doublecomplex
00047 *b, doublecomplex *x, doublecomplex *xact, doublecomplex *work,
00048 doublereal *rwork, integer *nout)
00049 {
00050
00051
00052 static integer iseedy[4] = { 1988,1989,1990,1991 };
00053 static char uplos[1*2] = "U" "L";
00054 static char transs[1*3] = "N" "T" "C";
00055
00056
00057 static char fmt_9999[] = "(\002 UPLO='\002,a1,\002', DIAG='\002,a1,\002'"
00058 ", N=\002,i5,\002, type \002,i2,\002, test(\002,i2,\002)= \002,g1"
00059 "2.5)";
00060 static char fmt_9998[] = "(\002 UPLO='\002,a1,\002', TRANS='\002,a1,\002"
00061 "', DIAG='\002,a1,\002', N=\002,i5,\002', NRHS=\002,i5,\002, type "
00062 "\002,i2,\002, test(\002,i2,\002)= \002,g12.5)";
00063 static char fmt_9997[] = "(1x,a,\002( '\002,a1,\002', '\002,a1,\002', "
00064 "'\002,a1,\002',\002,i5,\002, ... ), type \002,i2,\002, test(\002"
00065 ",i2,\002)=\002,g12.5)";
00066 static char fmt_9996[] = "(1x,a,\002( '\002,a1,\002', '\002,a1,\002', "
00067 "'\002,a1,\002', '\002,a1,\002',\002,i5,\002, ... ), type \002,i2,"
00068 "\002, test(\002,i2,\002)=\002,g12.5)";
00069
00070
00071 address a__1[2], a__2[3], a__3[4];
00072 integer i__1, i__2[2], i__3, i__4[3], i__5[4];
00073 char ch__1[2], ch__2[3], ch__3[4];
00074
00075
00076 int s_copy(char *, char *, ftnlen, ftnlen), s_cat(char *,
00077 char **, integer *, integer *, ftnlen);
00078 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00079
00080
00081 integer i__, k, n, in, lda, lap;
00082 char diag[1];
00083 integer imat, info;
00084 char path[3];
00085 integer irhs, nrhs;
00086 char norm[1], uplo[1];
00087 integer nrun;
00088 extern int alahd_(integer *, char *);
00089 integer idiag;
00090 doublereal scale;
00091 integer nfail, iseed[4];
00092 extern logical lsame_(char *, char *);
00093 doublereal rcond, anorm;
00094 integer itran;
00095 extern int zget04_(integer *, integer *, doublecomplex *,
00096 integer *, doublecomplex *, integer *, doublereal *, doublereal *
00097 );
00098 char trans[1];
00099 integer iuplo, nerrs;
00100 extern int ztpt01_(char *, char *, integer *,
00101 doublecomplex *, doublecomplex *, doublereal *, doublereal *,
00102 doublereal *), zcopy_(integer *, doublecomplex *,
00103 integer *, doublecomplex *, integer *), ztpt02_(char *, char *,
00104 char *, integer *, integer *, doublecomplex *, doublecomplex *,
00105 integer *, doublecomplex *, integer *, doublecomplex *,
00106 doublereal *, doublereal *), ztpt03_(char
00107 *, char *, char *, integer *, integer *, doublecomplex *,
00108 doublereal *, doublereal *, doublereal *, doublecomplex *,
00109 integer *, doublecomplex *, integer *, doublecomplex *,
00110 doublereal *), ztpt05_(char *, char *,
00111 char *, integer *, integer *, doublecomplex *, doublecomplex *,
00112 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00113 doublereal *, doublereal *, doublereal *)
00114 ;
00115 char xtype[1];
00116 extern int ztpt06_(doublereal *, doublereal *, char *,
00117 char *, integer *, doublecomplex *, doublereal *, doublereal *), alaerh_(char *, char *, integer *, integer *,
00118 char *, integer *, integer *, integer *, integer *, integer *,
00119 integer *, integer *, integer *, integer *);
00120 doublereal rcondc, rcondi;
00121 extern int alasum_(char *, integer *, integer *, integer
00122 *, integer *);
00123 doublereal rcondo, ainvnm;
00124 extern int zlacpy_(char *, integer *, integer *,
00125 doublecomplex *, integer *, doublecomplex *, integer *),
00126 zlarhs_(char *, char *, char *, char *, integer *, integer *,
00127 integer *, integer *, integer *, doublecomplex *, integer *,
00128 doublecomplex *, integer *, doublecomplex *, integer *, integer *,
00129 integer *);
00130 extern doublereal zlantp_(char *, char *, char *, integer *,
00131 doublecomplex *, doublereal *);
00132 extern int zlatps_(char *, char *, char *, char *,
00133 integer *, doublecomplex *, doublecomplex *, doublereal *,
00134 doublereal *, integer *);
00135 doublereal result[9];
00136 extern int zlattp_(integer *, char *, char *, char *,
00137 integer *, integer *, doublecomplex *, doublecomplex *,
00138 doublecomplex *, doublereal *, integer *),
00139 ztpcon_(char *, char *, char *, integer *, doublecomplex *,
00140 doublereal *, doublecomplex *, doublereal *, integer *), zerrtr_(char *, integer *), ztprfs_(char
00141 *, char *, char *, integer *, integer *, doublecomplex *,
00142 doublecomplex *, integer *, doublecomplex *, integer *,
00143 doublereal *, doublereal *, doublecomplex *, doublereal *,
00144 integer *), ztptri_(char *, char *,
00145 integer *, doublecomplex *, integer *), ztptrs_(
00146 char *, char *, char *, integer *, integer *, doublecomplex *,
00147 doublecomplex *, integer *, integer *);
00148
00149
00150 static cilist io___26 = { 0, 0, 0, fmt_9999, 0 };
00151 static cilist io___34 = { 0, 0, 0, fmt_9998, 0 };
00152 static cilist io___36 = { 0, 0, 0, fmt_9997, 0 };
00153 static cilist io___38 = { 0, 0, 0, fmt_9996, 0 };
00154 static cilist io___39 = { 0, 0, 0, fmt_9996, 0 };
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
00243
00244 --rwork;
00245 --work;
00246 --xact;
00247 --x;
00248 --b;
00249 --ainvp;
00250 --ap;
00251 --nsval;
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, "TP", (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 zerrtr_(path, nout);
00275 }
00276 infoc_1.infot = 0;
00277
00278 i__1 = *nn;
00279 for (in = 1; in <= i__1; ++in) {
00280
00281
00282
00283 n = nval[in];
00284 lda = max(1,n);
00285 lap = lda * (lda + 1) / 2;
00286 *(unsigned char *)xtype = 'N';
00287
00288 for (imat = 1; imat <= 10; ++imat) {
00289
00290
00291
00292 if (! dotype[imat]) {
00293 goto L70;
00294 }
00295
00296 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00297
00298
00299
00300 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00301
00302
00303
00304 s_copy(srnamc_1.srnamt, "ZLATTP", (ftnlen)32, (ftnlen)6);
00305 zlattp_(&imat, uplo, "No transpose", diag, iseed, &n, &ap[1],
00306 &x[1], &work[1], &rwork[1], &info);
00307
00308
00309
00310 if (lsame_(diag, "N")) {
00311 idiag = 1;
00312 } else {
00313 idiag = 2;
00314 }
00315
00316
00317
00318
00319 if (n > 0) {
00320 zcopy_(&lap, &ap[1], &c__1, &ainvp[1], &c__1);
00321 }
00322 s_copy(srnamc_1.srnamt, "ZTPTRI", (ftnlen)32, (ftnlen)6);
00323 ztptri_(uplo, diag, &n, &ainvp[1], &info);
00324
00325
00326
00327 if (info != 0) {
00328
00329 i__2[0] = 1, a__1[0] = uplo;
00330 i__2[1] = 1, a__1[1] = diag;
00331 s_cat(ch__1, a__1, i__2, &c__2, (ftnlen)2);
00332 alaerh_(path, "ZTPTRI", &info, &c__0, ch__1, &n, &n, &
00333 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00334 }
00335
00336
00337
00338 anorm = zlantp_("I", uplo, diag, &n, &ap[1], &rwork[1]);
00339 ainvnm = zlantp_("I", uplo, diag, &n, &ainvp[1], &rwork[1]);
00340 if (anorm <= 0. || ainvnm <= 0.) {
00341 rcondi = 1.;
00342 } else {
00343 rcondi = 1. / anorm / ainvnm;
00344 }
00345
00346
00347
00348
00349 ztpt01_(uplo, diag, &n, &ap[1], &ainvp[1], &rcondo, &rwork[1],
00350 result);
00351
00352
00353
00354 if (result[0] >= *thresh) {
00355 if (nfail == 0 && nerrs == 0) {
00356 alahd_(nout, path);
00357 }
00358 io___26.ciunit = *nout;
00359 s_wsfe(&io___26);
00360 do_fio(&c__1, uplo, (ftnlen)1);
00361 do_fio(&c__1, diag, (ftnlen)1);
00362 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00363 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00364 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00365 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(
00366 doublereal));
00367 e_wsfe();
00368 ++nfail;
00369 }
00370 ++nrun;
00371
00372 i__3 = *nns;
00373 for (irhs = 1; irhs <= i__3; ++irhs) {
00374 nrhs = nsval[irhs];
00375 *(unsigned char *)xtype = 'N';
00376
00377 for (itran = 1; itran <= 3; ++itran) {
00378
00379
00380
00381 *(unsigned char *)trans = *(unsigned char *)&transs[
00382 itran - 1];
00383 if (itran == 1) {
00384 *(unsigned char *)norm = 'O';
00385 rcondc = rcondo;
00386 } else {
00387 *(unsigned char *)norm = 'I';
00388 rcondc = rcondi;
00389 }
00390
00391
00392
00393
00394 s_copy(srnamc_1.srnamt, "ZLARHS", (ftnlen)32, (ftnlen)
00395 6);
00396 zlarhs_(path, xtype, uplo, trans, &n, &n, &c__0, &
00397 idiag, &nrhs, &ap[1], &lap, &xact[1], &lda, &
00398 b[1], &lda, iseed, &info);
00399 *(unsigned char *)xtype = 'C';
00400 zlacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &lda);
00401
00402 s_copy(srnamc_1.srnamt, "ZTPTRS", (ftnlen)32, (ftnlen)
00403 6);
00404 ztptrs_(uplo, trans, diag, &n, &nrhs, &ap[1], &x[1], &
00405 lda, &info);
00406
00407
00408
00409 if (info != 0) {
00410
00411 i__4[0] = 1, a__2[0] = uplo;
00412 i__4[1] = 1, a__2[1] = trans;
00413 i__4[2] = 1, a__2[2] = diag;
00414 s_cat(ch__2, a__2, i__4, &c__3, (ftnlen)3);
00415 alaerh_(path, "ZTPTRS", &info, &c__0, ch__2, &n, &
00416 n, &c_n1, &c_n1, &c_n1, &imat, &nfail, &
00417 nerrs, nout);
00418 }
00419
00420 ztpt02_(uplo, trans, diag, &n, &nrhs, &ap[1], &x[1], &
00421 lda, &b[1], &lda, &work[1], &rwork[1], &
00422 result[1]);
00423
00424
00425
00426
00427 zget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00428 rcondc, &result[2]);
00429
00430
00431
00432
00433
00434 s_copy(srnamc_1.srnamt, "ZTPRFS", (ftnlen)32, (ftnlen)
00435 6);
00436 ztprfs_(uplo, trans, diag, &n, &nrhs, &ap[1], &b[1], &
00437 lda, &x[1], &lda, &rwork[1], &rwork[nrhs + 1],
00438 &work[1], &rwork[(nrhs << 1) + 1], &info);
00439
00440
00441
00442 if (info != 0) {
00443
00444 i__4[0] = 1, a__2[0] = uplo;
00445 i__4[1] = 1, a__2[1] = trans;
00446 i__4[2] = 1, a__2[2] = diag;
00447 s_cat(ch__2, a__2, i__4, &c__3, (ftnlen)3);
00448 alaerh_(path, "ZTPRFS", &info, &c__0, ch__2, &n, &
00449 n, &c_n1, &c_n1, &nrhs, &imat, &nfail, &
00450 nerrs, nout);
00451 }
00452
00453 zget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00454 rcondc, &result[3]);
00455 ztpt05_(uplo, trans, diag, &n, &nrhs, &ap[1], &b[1], &
00456 lda, &x[1], &lda, &xact[1], &lda, &rwork[1], &
00457 rwork[nrhs + 1], &result[4]);
00458
00459
00460
00461
00462 for (k = 2; k <= 6; ++k) {
00463 if (result[k - 1] >= *thresh) {
00464 if (nfail == 0 && nerrs == 0) {
00465 alahd_(nout, path);
00466 }
00467 io___34.ciunit = *nout;
00468 s_wsfe(&io___34);
00469 do_fio(&c__1, uplo, (ftnlen)1);
00470 do_fio(&c__1, trans, (ftnlen)1);
00471 do_fio(&c__1, diag, (ftnlen)1);
00472 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00473 integer));
00474 do_fio(&c__1, (char *)&nrhs, (ftnlen)sizeof(
00475 integer));
00476 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00477 integer));
00478 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00479 integer));
00480 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00481 sizeof(doublereal));
00482 e_wsfe();
00483 ++nfail;
00484 }
00485
00486 }
00487 nrun += 5;
00488
00489 }
00490
00491 }
00492
00493
00494
00495
00496 for (itran = 1; itran <= 2; ++itran) {
00497 if (itran == 1) {
00498 *(unsigned char *)norm = 'O';
00499 rcondc = rcondo;
00500 } else {
00501 *(unsigned char *)norm = 'I';
00502 rcondc = rcondi;
00503 }
00504 s_copy(srnamc_1.srnamt, "ZTPCON", (ftnlen)32, (ftnlen)6);
00505 ztpcon_(norm, uplo, diag, &n, &ap[1], &rcond, &work[1], &
00506 rwork[1], &info);
00507
00508
00509
00510 if (info != 0) {
00511
00512 i__4[0] = 1, a__2[0] = norm;
00513 i__4[1] = 1, a__2[1] = uplo;
00514 i__4[2] = 1, a__2[2] = diag;
00515 s_cat(ch__2, a__2, i__4, &c__3, (ftnlen)3);
00516 alaerh_(path, "ZTPCON", &info, &c__0, ch__2, &n, &n, &
00517 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00518 nout);
00519 }
00520
00521 ztpt06_(&rcond, &rcondc, uplo, diag, &n, &ap[1], &rwork[1]
00522 , &result[6]);
00523
00524
00525
00526 if (result[6] >= *thresh) {
00527 if (nfail == 0 && nerrs == 0) {
00528 alahd_(nout, path);
00529 }
00530 io___36.ciunit = *nout;
00531 s_wsfe(&io___36);
00532 do_fio(&c__1, "ZTPCON", (ftnlen)6);
00533 do_fio(&c__1, norm, (ftnlen)1);
00534 do_fio(&c__1, uplo, (ftnlen)1);
00535 do_fio(&c__1, diag, (ftnlen)1);
00536 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00537 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00538 do_fio(&c__1, (char *)&c__7, (ftnlen)sizeof(integer));
00539 do_fio(&c__1, (char *)&result[6], (ftnlen)sizeof(
00540 doublereal));
00541 e_wsfe();
00542 ++nfail;
00543 }
00544 ++nrun;
00545
00546 }
00547
00548 }
00549 L70:
00550 ;
00551 }
00552
00553
00554
00555 for (imat = 11; imat <= 18; ++imat) {
00556
00557
00558
00559 if (! dotype[imat]) {
00560 goto L100;
00561 }
00562
00563 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00564
00565
00566
00567 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00568 for (itran = 1; itran <= 3; ++itran) {
00569
00570
00571
00572 *(unsigned char *)trans = *(unsigned char *)&transs[itran
00573 - 1];
00574
00575
00576
00577 s_copy(srnamc_1.srnamt, "ZLATTP", (ftnlen)32, (ftnlen)6);
00578 zlattp_(&imat, uplo, trans, diag, iseed, &n, &ap[1], &x[1]
00579 , &work[1], &rwork[1], &info);
00580
00581
00582
00583
00584 s_copy(srnamc_1.srnamt, "ZLATPS", (ftnlen)32, (ftnlen)6);
00585 zcopy_(&n, &x[1], &c__1, &b[1], &c__1);
00586 zlatps_(uplo, trans, diag, "N", &n, &ap[1], &b[1], &scale,
00587 &rwork[1], &info);
00588
00589
00590
00591 if (info != 0) {
00592
00593 i__5[0] = 1, a__3[0] = uplo;
00594 i__5[1] = 1, a__3[1] = trans;
00595 i__5[2] = 1, a__3[2] = diag;
00596 i__5[3] = 1, a__3[3] = "N";
00597 s_cat(ch__3, a__3, i__5, &c__4, (ftnlen)4);
00598 alaerh_(path, "ZLATPS", &info, &c__0, ch__3, &n, &n, &
00599 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00600 nout);
00601 }
00602
00603 ztpt03_(uplo, trans, diag, &n, &c__1, &ap[1], &scale, &
00604 rwork[1], &c_b103, &b[1], &lda, &x[1], &lda, &
00605 work[1], &result[7]);
00606
00607
00608
00609
00610 zcopy_(&n, &x[1], &c__1, &b[n + 1], &c__1);
00611 zlatps_(uplo, trans, diag, "Y", &n, &ap[1], &b[n + 1], &
00612 scale, &rwork[1], &info);
00613
00614
00615
00616 if (info != 0) {
00617
00618 i__5[0] = 1, a__3[0] = uplo;
00619 i__5[1] = 1, a__3[1] = trans;
00620 i__5[2] = 1, a__3[2] = diag;
00621 i__5[3] = 1, a__3[3] = "Y";
00622 s_cat(ch__3, a__3, i__5, &c__4, (ftnlen)4);
00623 alaerh_(path, "ZLATPS", &info, &c__0, ch__3, &n, &n, &
00624 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00625 nout);
00626 }
00627
00628 ztpt03_(uplo, trans, diag, &n, &c__1, &ap[1], &scale, &
00629 rwork[1], &c_b103, &b[n + 1], &lda, &x[1], &lda, &
00630 work[1], &result[8]);
00631
00632
00633
00634
00635 if (result[7] >= *thresh) {
00636 if (nfail == 0 && nerrs == 0) {
00637 alahd_(nout, path);
00638 }
00639 io___38.ciunit = *nout;
00640 s_wsfe(&io___38);
00641 do_fio(&c__1, "ZLATPS", (ftnlen)6);
00642 do_fio(&c__1, uplo, (ftnlen)1);
00643 do_fio(&c__1, trans, (ftnlen)1);
00644 do_fio(&c__1, diag, (ftnlen)1);
00645 do_fio(&c__1, "N", (ftnlen)1);
00646 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00647 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00648 do_fio(&c__1, (char *)&c__8, (ftnlen)sizeof(integer));
00649 do_fio(&c__1, (char *)&result[7], (ftnlen)sizeof(
00650 doublereal));
00651 e_wsfe();
00652 ++nfail;
00653 }
00654 if (result[8] >= *thresh) {
00655 if (nfail == 0 && nerrs == 0) {
00656 alahd_(nout, path);
00657 }
00658 io___39.ciunit = *nout;
00659 s_wsfe(&io___39);
00660 do_fio(&c__1, "ZLATPS", (ftnlen)6);
00661 do_fio(&c__1, uplo, (ftnlen)1);
00662 do_fio(&c__1, trans, (ftnlen)1);
00663 do_fio(&c__1, diag, (ftnlen)1);
00664 do_fio(&c__1, "Y", (ftnlen)1);
00665 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00666 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00667 do_fio(&c__1, (char *)&c__9, (ftnlen)sizeof(integer));
00668 do_fio(&c__1, (char *)&result[8], (ftnlen)sizeof(
00669 doublereal));
00670 e_wsfe();
00671 ++nfail;
00672 }
00673 nrun += 2;
00674
00675 }
00676
00677 }
00678 L100:
00679 ;
00680 }
00681
00682 }
00683
00684
00685
00686 alasum_(path, nout, &nfail, &nrun, &nerrs);
00687
00688 return 0;
00689
00690
00691
00692 }