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__2 = 2;
00034 static integer c__1 = 1;
00035 static integer c__0 = 0;
00036 static integer c_n1 = -1;
00037 static integer c__3 = 3;
00038 static integer c__7 = 7;
00039 static integer c__4 = 4;
00040 static real c_b101 = 1.f;
00041 static integer c__8 = 8;
00042 static integer c__9 = 9;
00043
00044 int schktr_(logical *dotype, integer *nn, integer *nval,
00045 integer *nnb, integer *nbval, integer *nns, integer *nsval, real *
00046 thresh, logical *tsterr, integer *nmax, real *a, real *ainv, real *b,
00047 real *x, real *xact, real *work, real *rwork, integer *iwork, integer
00048 *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, NB=\002,i4,\002, type \002,i2,\002, test(\002,"
00059 "i2,\002)= \002,g12.5)";
00060 static char fmt_9998[] = "(\002 UPLO='\002,a1,\002', TRANS='\002,a1,\002"
00061 "', DIAG='\002,a1,\002', N=\002,i5,\002, NB=\002,i4,\002, type"
00062 " \002,i2,\002, test(\002,i2,\002)= \002,g12"
00063 ".5)";
00064 static char fmt_9997[] = "(\002 NORM='\002,a1,\002', UPLO ='\002,a1,\002"
00065 "', N=\002,i5,\002,\002,11x,\002 type \002,i2,\002, test(\002,i2"
00066 ",\002)=\002,g12.5)";
00067 static char fmt_9996[] = "(1x,a,\002( '\002,a1,\002', '\002,a1,\002', "
00068 "'\002,a1,\002', '\002,a1,\002',\002,i5,\002, ... ), type \002,i2,"
00069 "\002, test(\002,i2,\002)=\002,g12.5)";
00070
00071
00072 address a__1[2], a__2[3], a__3[4];
00073 integer i__1, i__2, i__3[2], i__4, i__5[3], i__6[4];
00074 char ch__1[2], ch__2[3], ch__3[4];
00075
00076
00077 int s_copy(char *, char *, ftnlen, ftnlen), s_cat(char *,
00078 char **, integer *, integer *, ftnlen);
00079 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00080
00081
00082 integer i__, k, n, nb, in, lda, inb;
00083 char diag[1];
00084 integer imat, info;
00085 char path[3];
00086 integer irhs, nrhs;
00087 char norm[1], uplo[1];
00088 integer nrun;
00089 extern int alahd_(integer *, char *);
00090 integer idiag;
00091 real scale;
00092 integer nfail, iseed[4];
00093 extern logical lsame_(char *, char *);
00094 real rcond;
00095 extern int sget04_(integer *, integer *, real *, integer
00096 *, real *, integer *, real *, real *);
00097 real anorm;
00098 integer itran;
00099 char trans[1];
00100 integer iuplo, nerrs;
00101 real dummy;
00102 extern int scopy_(integer *, real *, integer *, real *,
00103 integer *), strt01_(char *, char *, integer *, real *, integer *,
00104 real *, integer *, real *, real *, real *),
00105 strt02_(char *, char *, char *, integer *, integer *, real *,
00106 integer *, real *, integer *, real *, integer *, real *, real *), strt03_(char *, char *, char *, integer *
00107 , integer *, real *, integer *, real *, real *, real *, real *,
00108 integer *, real *, integer *, real *, real *), strt05_(char *, char *, char *, integer *, integer *,
00109 real *, integer *, real *, integer *, real *, integer *, real *,
00110 integer *, real *, real *, real *),
00111 strt06_(real *, real *, char *, char *, integer *, real *,
00112 integer *, real *, real *);
00113 char xtype[1];
00114 extern int alaerh_(char *, char *, integer *, integer *,
00115 char *, integer *, integer *, integer *, integer *, integer *,
00116 integer *, integer *, integer *, integer *);
00117 real rcondc, rcondi;
00118 extern int alasum_(char *, integer *, integer *, integer
00119 *, integer *);
00120 real rcondo, ainvnm;
00121 extern int slacpy_(char *, integer *, integer *, real *,
00122 integer *, real *, integer *), slarhs_(char *, char *,
00123 char *, char *, integer *, integer *, integer *, integer *,
00124 integer *, real *, integer *, real *, integer *, real *, integer *
00125 , integer *, integer *), xlaenv_(
00126 integer *, integer *);
00127 extern doublereal slantr_(char *, char *, char *, integer *, integer *,
00128 real *, integer *, real *);
00129 extern int slatrs_(char *, char *, char *, char *,
00130 integer *, real *, integer *, real *, real *, real *, integer *), slattr_(integer *, char *, char *
00131 , char *, integer *, integer *, real *, integer *, real *, real *,
00132 integer *), strcon_(char *, char *, char
00133 *, integer *, real *, integer *, real *, real *, integer *,
00134 integer *);
00135 real result[9];
00136 extern int serrtr_(char *, integer *), strrfs_(
00137 char *, char *, char *, integer *, integer *, real *, integer *,
00138 real *, integer *, real *, integer *, real *, real *, real *,
00139 integer *, integer *), strtri_(char *,
00140 char *, integer *, real *, integer *, integer *),
00141 strtrs_(char *, char *, char *, integer *, integer *, real *,
00142 integer *, real *, integer *, integer *);
00143
00144
00145 static cilist io___27 = { 0, 0, 0, fmt_9999, 0 };
00146 static cilist io___36 = { 0, 0, 0, fmt_9998, 0 };
00147 static cilist io___38 = { 0, 0, 0, fmt_9997, 0 };
00148 static cilist io___40 = { 0, 0, 0, fmt_9996, 0 };
00149 static cilist io___41 = { 0, 0, 0, fmt_9996, 0 };
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
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247 --iwork;
00248 --rwork;
00249 --work;
00250 --xact;
00251 --x;
00252 --b;
00253 --ainv;
00254 --a;
00255 --nsval;
00256 --nbval;
00257 --nval;
00258 --dotype;
00259
00260
00261
00262
00263
00264
00265
00266 s_copy(path, "Single precision", (ftnlen)1, (ftnlen)16);
00267 s_copy(path + 1, "TR", (ftnlen)2, (ftnlen)2);
00268 nrun = 0;
00269 nfail = 0;
00270 nerrs = 0;
00271 for (i__ = 1; i__ <= 4; ++i__) {
00272 iseed[i__ - 1] = iseedy[i__ - 1];
00273
00274 }
00275
00276
00277
00278 if (*tsterr) {
00279 serrtr_(path, nout);
00280 }
00281 infoc_1.infot = 0;
00282 xlaenv_(&c__2, &c__2);
00283
00284 i__1 = *nn;
00285 for (in = 1; in <= i__1; ++in) {
00286
00287
00288
00289 n = nval[in];
00290 lda = max(1,n);
00291 *(unsigned char *)xtype = 'N';
00292
00293 for (imat = 1; imat <= 10; ++imat) {
00294
00295
00296
00297 if (! dotype[imat]) {
00298 goto L80;
00299 }
00300
00301 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00302
00303
00304
00305 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00306
00307
00308
00309 s_copy(srnamc_1.srnamt, "SLATTR", (ftnlen)32, (ftnlen)6);
00310 slattr_(&imat, uplo, "No transpose", diag, iseed, &n, &a[1], &
00311 lda, &x[1], &work[1], &info);
00312
00313
00314
00315 if (lsame_(diag, "N")) {
00316 idiag = 1;
00317 } else {
00318 idiag = 2;
00319 }
00320
00321 i__2 = *nnb;
00322 for (inb = 1; inb <= i__2; ++inb) {
00323
00324
00325
00326 nb = nbval[inb];
00327 xlaenv_(&c__1, &nb);
00328
00329
00330
00331
00332 slacpy_(uplo, &n, &n, &a[1], &lda, &ainv[1], &lda);
00333 s_copy(srnamc_1.srnamt, "STRTRI", (ftnlen)32, (ftnlen)6);
00334 strtri_(uplo, diag, &n, &ainv[1], &lda, &info);
00335
00336
00337
00338 if (info != 0) {
00339
00340 i__3[0] = 1, a__1[0] = uplo;
00341 i__3[1] = 1, a__1[1] = diag;
00342 s_cat(ch__1, a__1, i__3, &c__2, (ftnlen)2);
00343 alaerh_(path, "STRTRI", &info, &c__0, ch__1, &n, &n, &
00344 c_n1, &c_n1, &nb, &imat, &nfail, &nerrs, nout);
00345 }
00346
00347
00348
00349 anorm = slantr_("I", uplo, diag, &n, &n, &a[1], &lda, &
00350 rwork[1]);
00351 ainvnm = slantr_("I", uplo, diag, &n, &n, &ainv[1], &lda,
00352 &rwork[1]);
00353 if (anorm <= 0.f || ainvnm <= 0.f) {
00354 rcondi = 1.f;
00355 } else {
00356 rcondi = 1.f / anorm / ainvnm;
00357 }
00358
00359
00360
00361
00362
00363 strt01_(uplo, diag, &n, &a[1], &lda, &ainv[1], &lda, &
00364 rcondo, &rwork[1], result);
00365
00366
00367
00368 if (result[0] >= *thresh) {
00369 if (nfail == 0 && nerrs == 0) {
00370 alahd_(nout, path);
00371 }
00372 io___27.ciunit = *nout;
00373 s_wsfe(&io___27);
00374 do_fio(&c__1, uplo, (ftnlen)1);
00375 do_fio(&c__1, diag, (ftnlen)1);
00376 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00377 do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(integer));
00378 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00379 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00380 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(real)
00381 );
00382 e_wsfe();
00383 ++nfail;
00384 }
00385 ++nrun;
00386
00387
00388
00389 if (inb != 1) {
00390 goto L60;
00391 }
00392
00393 i__4 = *nns;
00394 for (irhs = 1; irhs <= i__4; ++irhs) {
00395 nrhs = nsval[irhs];
00396 *(unsigned char *)xtype = 'N';
00397
00398 for (itran = 1; itran <= 3; ++itran) {
00399
00400
00401
00402 *(unsigned char *)trans = *(unsigned char *)&
00403 transs[itran - 1];
00404 if (itran == 1) {
00405 *(unsigned char *)norm = 'O';
00406 rcondc = rcondo;
00407 } else {
00408 *(unsigned char *)norm = 'I';
00409 rcondc = rcondi;
00410 }
00411
00412
00413
00414
00415 s_copy(srnamc_1.srnamt, "SLARHS", (ftnlen)32, (
00416 ftnlen)6);
00417 slarhs_(path, xtype, uplo, trans, &n, &n, &c__0, &
00418 idiag, &nrhs, &a[1], &lda, &xact[1], &lda,
00419 &b[1], &lda, iseed, &info);
00420 *(unsigned char *)xtype = 'C';
00421 slacpy_("Full", &n, &nrhs, &b[1], &lda, &x[1], &
00422 lda);
00423
00424 s_copy(srnamc_1.srnamt, "STRTRS", (ftnlen)32, (
00425 ftnlen)6);
00426 strtrs_(uplo, trans, diag, &n, &nrhs, &a[1], &lda,
00427 &x[1], &lda, &info);
00428
00429
00430
00431 if (info != 0) {
00432
00433 i__5[0] = 1, a__2[0] = uplo;
00434 i__5[1] = 1, a__2[1] = trans;
00435 i__5[2] = 1, a__2[2] = diag;
00436 s_cat(ch__2, a__2, i__5, &c__3, (ftnlen)3);
00437 alaerh_(path, "STRTRS", &info, &c__0, ch__2, &
00438 n, &n, &c_n1, &c_n1, &nrhs, &imat, &
00439 nfail, &nerrs, nout);
00440 }
00441
00442
00443
00444 if (n > 0) {
00445 dummy = a[1];
00446 }
00447
00448 strt02_(uplo, trans, diag, &n, &nrhs, &a[1], &lda,
00449 &x[1], &lda, &b[1], &lda, &work[1], &
00450 result[1]);
00451
00452
00453
00454
00455 sget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00456 rcondc, &result[2]);
00457
00458
00459
00460
00461
00462 s_copy(srnamc_1.srnamt, "STRRFS", (ftnlen)32, (
00463 ftnlen)6);
00464 strrfs_(uplo, trans, diag, &n, &nrhs, &a[1], &lda,
00465 &b[1], &lda, &x[1], &lda, &rwork[1], &
00466 rwork[nrhs + 1], &work[1], &iwork[1], &
00467 info);
00468
00469
00470
00471 if (info != 0) {
00472
00473 i__5[0] = 1, a__2[0] = uplo;
00474 i__5[1] = 1, a__2[1] = trans;
00475 i__5[2] = 1, a__2[2] = diag;
00476 s_cat(ch__2, a__2, i__5, &c__3, (ftnlen)3);
00477 alaerh_(path, "STRRFS", &info, &c__0, ch__2, &
00478 n, &n, &c_n1, &c_n1, &nrhs, &imat, &
00479 nfail, &nerrs, nout);
00480 }
00481
00482 sget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00483 rcondc, &result[3]);
00484 strt05_(uplo, trans, diag, &n, &nrhs, &a[1], &lda,
00485 &b[1], &lda, &x[1], &lda, &xact[1], &lda,
00486 &rwork[1], &rwork[nrhs + 1], &result[4]);
00487
00488
00489
00490
00491 for (k = 2; k <= 6; ++k) {
00492 if (result[k - 1] >= *thresh) {
00493 if (nfail == 0 && nerrs == 0) {
00494 alahd_(nout, path);
00495 }
00496 io___36.ciunit = *nout;
00497 s_wsfe(&io___36);
00498 do_fio(&c__1, uplo, (ftnlen)1);
00499 do_fio(&c__1, trans, (ftnlen)1);
00500 do_fio(&c__1, diag, (ftnlen)1);
00501 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00502 integer));
00503 do_fio(&c__1, (char *)&nrhs, (ftnlen)
00504 sizeof(integer));
00505 do_fio(&c__1, (char *)&imat, (ftnlen)
00506 sizeof(integer));
00507 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00508 integer));
00509 do_fio(&c__1, (char *)&result[k - 1], (
00510 ftnlen)sizeof(real));
00511 e_wsfe();
00512 ++nfail;
00513 }
00514
00515 }
00516 nrun += 5;
00517
00518 }
00519
00520 }
00521
00522
00523
00524
00525 for (itran = 1; itran <= 2; ++itran) {
00526 if (itran == 1) {
00527 *(unsigned char *)norm = 'O';
00528 rcondc = rcondo;
00529 } else {
00530 *(unsigned char *)norm = 'I';
00531 rcondc = rcondi;
00532 }
00533 s_copy(srnamc_1.srnamt, "STRCON", (ftnlen)32, (ftnlen)
00534 6);
00535 strcon_(norm, uplo, diag, &n, &a[1], &lda, &rcond, &
00536 work[1], &iwork[1], &info);
00537
00538
00539
00540 if (info != 0) {
00541
00542 i__5[0] = 1, a__2[0] = norm;
00543 i__5[1] = 1, a__2[1] = uplo;
00544 i__5[2] = 1, a__2[2] = diag;
00545 s_cat(ch__2, a__2, i__5, &c__3, (ftnlen)3);
00546 alaerh_(path, "STRCON", &info, &c__0, ch__2, &n, &
00547 n, &c_n1, &c_n1, &c_n1, &imat, &nfail, &
00548 nerrs, nout);
00549 }
00550
00551 strt06_(&rcond, &rcondc, uplo, diag, &n, &a[1], &lda,
00552 &rwork[1], &result[6]);
00553
00554
00555
00556 if (result[6] >= *thresh) {
00557 if (nfail == 0 && nerrs == 0) {
00558 alahd_(nout, path);
00559 }
00560 io___38.ciunit = *nout;
00561 s_wsfe(&io___38);
00562 do_fio(&c__1, norm, (ftnlen)1);
00563 do_fio(&c__1, uplo, (ftnlen)1);
00564 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00565 ;
00566 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00567 integer));
00568 do_fio(&c__1, (char *)&c__7, (ftnlen)sizeof(
00569 integer));
00570 do_fio(&c__1, (char *)&result[6], (ftnlen)sizeof(
00571 real));
00572 e_wsfe();
00573 ++nfail;
00574 }
00575 ++nrun;
00576
00577 }
00578 L60:
00579 ;
00580 }
00581
00582 }
00583 L80:
00584 ;
00585 }
00586
00587
00588
00589 for (imat = 11; imat <= 18; ++imat) {
00590
00591
00592
00593 if (! dotype[imat]) {
00594 goto L110;
00595 }
00596
00597 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00598
00599
00600
00601 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00602 for (itran = 1; itran <= 3; ++itran) {
00603
00604
00605
00606 *(unsigned char *)trans = *(unsigned char *)&transs[itran
00607 - 1];
00608
00609
00610
00611 s_copy(srnamc_1.srnamt, "SLATTR", (ftnlen)32, (ftnlen)6);
00612 slattr_(&imat, uplo, trans, diag, iseed, &n, &a[1], &lda,
00613 &x[1], &work[1], &info);
00614
00615
00616
00617
00618 s_copy(srnamc_1.srnamt, "SLATRS", (ftnlen)32, (ftnlen)6);
00619 scopy_(&n, &x[1], &c__1, &b[1], &c__1);
00620 slatrs_(uplo, trans, diag, "N", &n, &a[1], &lda, &b[1], &
00621 scale, &rwork[1], &info);
00622
00623
00624
00625 if (info != 0) {
00626
00627 i__6[0] = 1, a__3[0] = uplo;
00628 i__6[1] = 1, a__3[1] = trans;
00629 i__6[2] = 1, a__3[2] = diag;
00630 i__6[3] = 1, a__3[3] = "N";
00631 s_cat(ch__3, a__3, i__6, &c__4, (ftnlen)4);
00632 alaerh_(path, "SLATRS", &info, &c__0, ch__3, &n, &n, &
00633 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00634 nout);
00635 }
00636
00637 strt03_(uplo, trans, diag, &n, &c__1, &a[1], &lda, &scale,
00638 &rwork[1], &c_b101, &b[1], &lda, &x[1], &lda, &
00639 work[1], &result[7]);
00640
00641
00642
00643
00644 scopy_(&n, &x[1], &c__1, &b[n + 1], &c__1);
00645 slatrs_(uplo, trans, diag, "Y", &n, &a[1], &lda, &b[n + 1]
00646 , &scale, &rwork[1], &info);
00647
00648
00649
00650 if (info != 0) {
00651
00652 i__6[0] = 1, a__3[0] = uplo;
00653 i__6[1] = 1, a__3[1] = trans;
00654 i__6[2] = 1, a__3[2] = diag;
00655 i__6[3] = 1, a__3[3] = "Y";
00656 s_cat(ch__3, a__3, i__6, &c__4, (ftnlen)4);
00657 alaerh_(path, "SLATRS", &info, &c__0, ch__3, &n, &n, &
00658 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00659 nout);
00660 }
00661
00662 strt03_(uplo, trans, diag, &n, &c__1, &a[1], &lda, &scale,
00663 &rwork[1], &c_b101, &b[n + 1], &lda, &x[1], &lda,
00664 &work[1], &result[8]);
00665
00666
00667
00668
00669 if (result[7] >= *thresh) {
00670 if (nfail == 0 && nerrs == 0) {
00671 alahd_(nout, path);
00672 }
00673 io___40.ciunit = *nout;
00674 s_wsfe(&io___40);
00675 do_fio(&c__1, "SLATRS", (ftnlen)6);
00676 do_fio(&c__1, uplo, (ftnlen)1);
00677 do_fio(&c__1, trans, (ftnlen)1);
00678 do_fio(&c__1, diag, (ftnlen)1);
00679 do_fio(&c__1, "N", (ftnlen)1);
00680 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00681 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00682 do_fio(&c__1, (char *)&c__8, (ftnlen)sizeof(integer));
00683 do_fio(&c__1, (char *)&result[7], (ftnlen)sizeof(real)
00684 );
00685 e_wsfe();
00686 ++nfail;
00687 }
00688 if (result[8] >= *thresh) {
00689 if (nfail == 0 && nerrs == 0) {
00690 alahd_(nout, path);
00691 }
00692 io___41.ciunit = *nout;
00693 s_wsfe(&io___41);
00694 do_fio(&c__1, "SLATRS", (ftnlen)6);
00695 do_fio(&c__1, uplo, (ftnlen)1);
00696 do_fio(&c__1, trans, (ftnlen)1);
00697 do_fio(&c__1, diag, (ftnlen)1);
00698 do_fio(&c__1, "Y", (ftnlen)1);
00699 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00700 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00701 do_fio(&c__1, (char *)&c__9, (ftnlen)sizeof(integer));
00702 do_fio(&c__1, (char *)&result[8], (ftnlen)sizeof(real)
00703 );
00704 e_wsfe();
00705 ++nfail;
00706 }
00707 nrun += 2;
00708
00709 }
00710
00711 }
00712 L110:
00713 ;
00714 }
00715
00716 }
00717
00718
00719
00720 alasum_(path, nout, &nfail, &nrun, &nerrs);
00721
00722 return 0;
00723
00724
00725
00726 }