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 char srnamt[32];
00020 } srnamc_;
00021
00022 #define srnamc_1 srnamc_
00023
00024
00025
00026 static integer c__0 = 0;
00027 static integer c_n1 = -1;
00028 static integer c__1 = 1;
00029
00030 int ddrvrfp_(integer *nout, integer *nn, integer *nval,
00031 integer *nns, integer *nsval, integer *nnt, integer *ntval,
00032 doublereal *thresh, doublereal *a, doublereal *asav, doublereal *afac,
00033 doublereal *ainv, doublereal *b, doublereal *bsav, doublereal *xact,
00034 doublereal *x, doublereal *arf, doublereal *arfinv, doublereal *
00035 d_work_dlatms__, doublereal *d_work_dpot01__, doublereal *
00036 d_temp_dpot02__, doublereal *d_temp_dpot03__, doublereal *
00037 d_work_dlansy__, doublereal *d_work_dpot02__, doublereal *
00038 d_work_dpot03__)
00039 {
00040
00041
00042 static integer iseedy[4] = { 1988,1989,1990,1991 };
00043 static char uplos[1*2] = "U" "L";
00044 static char forms[1*2] = "N" "T";
00045
00046
00047 static char fmt_9999[] = "(1x,a6,\002, UPLO='\002,a1,\002', N =\002,i5"
00048 ",\002, type \002,i1,\002, test(\002,i1,\002)=\002,g12.5)";
00049
00050
00051 integer i__1, i__2, i__3, i__4, i__5, i__6, i__7;
00052
00053
00054 int s_copy(char *, char *, ftnlen, ftnlen);
00055 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00056
00057
00058 integer i__, k, n, kl, ku, nt, lda, ldb, iin, iis, iit, ioff, mode, info,
00059 imat;
00060 char dist[1];
00061 integer nrhs;
00062 char uplo[1];
00063 integer nrun;
00064 extern int dget04_(integer *, integer *, doublereal *,
00065 integer *, doublereal *, integer *, doublereal *, doublereal *);
00066 integer nfail, iseed[4];
00067 char cform[1];
00068 extern int dpot01_(char *, integer *, doublereal *,
00069 integer *, doublereal *, integer *, doublereal *, doublereal *), dpot02_(char *, integer *, integer *, doublereal *,
00070 integer *, doublereal *, integer *, doublereal *, integer *,
00071 doublereal *, doublereal *), dpot03_(char *, integer *,
00072 doublereal *, integer *, doublereal *, integer *, doublereal *,
00073 integer *, doublereal *, doublereal *, doublereal *);
00074 integer iform;
00075 doublereal anorm;
00076 char ctype[1];
00077 integer iuplo, nerrs, izero;
00078 logical zerot;
00079 extern int dlatb4_(char *, integer *, integer *, integer
00080 *, char *, integer *, integer *, doublereal *, integer *,
00081 doublereal *, char *), aladhd_(integer *,
00082 char *), alaerh_(char *, char *, integer *, integer *,
00083 char *, integer *, integer *, integer *, integer *, integer *,
00084 integer *, integer *, integer *, integer *);
00085 doublereal rcondc;
00086 extern int dlacpy_(char *, integer *, integer *,
00087 doublereal *, integer *, doublereal *, integer *),
00088 dlarhs_(char *, char *, char *, char *, integer *, integer *,
00089 integer *, integer *, integer *, doublereal *, integer *,
00090 doublereal *, integer *, doublereal *, integer *, integer *,
00091 integer *), alasvm_(char *,
00092 integer *, integer *, integer *, integer *);
00093 doublereal cndnum;
00094 extern int dlatms_(integer *, integer *, char *, integer
00095 *, char *, doublereal *, integer *, doublereal *, doublereal *,
00096 integer *, integer *, char *, doublereal *, integer *, doublereal
00097 *, integer *), dpftrf_(char *, char *,
00098 integer *, doublereal *, integer *);
00099 doublereal ainvnm;
00100 extern int dpftri_(char *, char *, integer *, doublereal
00101 *, integer *);
00102 extern doublereal dlansy_(char *, char *, integer *, doublereal *,
00103 integer *, doublereal *);
00104 extern int dpotrf_(char *, integer *, doublereal *,
00105 integer *, integer *), dpotri_(char *, integer *,
00106 doublereal *, integer *, integer *), dpftrs_(char *, char
00107 *, integer *, integer *, doublereal *, doublereal *, integer *,
00108 integer *), dtfttr_(char *, char *, integer *,
00109 doublereal *, doublereal *, integer *, integer *),
00110 dtrttf_(char *, char *, integer *, doublereal *, integer *,
00111 doublereal *, integer *);
00112 doublereal result[4];
00113
00114
00115 static cilist io___37 = { 0, 0, 0, fmt_9999, 0 };
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
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
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247 --nval;
00248 --nsval;
00249 --ntval;
00250 --a;
00251 --asav;
00252 --afac;
00253 --ainv;
00254 --b;
00255 --bsav;
00256 --xact;
00257 --x;
00258 --arf;
00259 --arfinv;
00260 --d_work_dlatms__;
00261 --d_work_dpot01__;
00262 --d_temp_dpot02__;
00263 --d_temp_dpot03__;
00264 --d_work_dlansy__;
00265 --d_work_dpot02__;
00266 --d_work_dpot03__;
00267
00268
00269
00270
00271
00272
00273
00274 nrun = 0;
00275 nfail = 0;
00276 nerrs = 0;
00277 for (i__ = 1; i__ <= 4; ++i__) {
00278 iseed[i__ - 1] = iseedy[i__ - 1];
00279
00280 }
00281
00282 i__1 = *nn;
00283 for (iin = 1; iin <= i__1; ++iin) {
00284
00285 n = nval[iin];
00286 lda = max(n,1);
00287 ldb = max(n,1);
00288
00289 i__2 = *nns;
00290 for (iis = 1; iis <= i__2; ++iis) {
00291
00292 nrhs = nsval[iis];
00293
00294 i__3 = *nnt;
00295 for (iit = 1; iit <= i__3; ++iit) {
00296
00297 imat = ntval[iit];
00298
00299
00300
00301 if (n == 0 && iit > 1) {
00302 goto L120;
00303 }
00304
00305
00306
00307 if (imat == 4 && n <= 1) {
00308 goto L120;
00309 }
00310 if (imat == 5 && n <= 2) {
00311 goto L120;
00312 }
00313
00314
00315
00316 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00317 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo -
00318 1];
00319
00320
00321
00322 for (iform = 1; iform <= 2; ++iform) {
00323 *(unsigned char *)cform = *(unsigned char *)&forms[
00324 iform - 1];
00325
00326
00327
00328
00329 dlatb4_("DPO", &imat, &n, &n, ctype, &kl, &ku, &anorm,
00330 &mode, &cndnum, dist);
00331
00332 s_copy(srnamc_1.srnamt, "DLATMS", (ftnlen)32, (ftnlen)
00333 6);
00334 dlatms_(&n, &n, dist, iseed, ctype, &d_work_dlatms__[
00335 1], &mode, &cndnum, &anorm, &kl, &ku, uplo, &
00336 a[1], &lda, &d_work_dlatms__[1], &info);
00337
00338
00339
00340 if (info != 0) {
00341 alaerh_("DPF", "DLATMS", &info, &c__0, uplo, &n, &
00342 n, &c_n1, &c_n1, &c_n1, &iit, &nfail, &
00343 nerrs, nout);
00344 goto L100;
00345 }
00346
00347
00348
00349
00350 zerot = imat >= 3 && imat <= 5;
00351 if (zerot) {
00352 if (iit == 3) {
00353 izero = 1;
00354 } else if (iit == 4) {
00355 izero = n;
00356 } else {
00357 izero = n / 2 + 1;
00358 }
00359 ioff = (izero - 1) * lda;
00360
00361
00362
00363 if (iuplo == 1) {
00364 i__4 = izero - 1;
00365 for (i__ = 1; i__ <= i__4; ++i__) {
00366 a[ioff + i__] = 0.;
00367
00368 }
00369 ioff += izero;
00370 i__4 = n;
00371 for (i__ = izero; i__ <= i__4; ++i__) {
00372 a[ioff] = 0.;
00373 ioff += lda;
00374
00375 }
00376 } else {
00377 ioff = izero;
00378 i__4 = izero - 1;
00379 for (i__ = 1; i__ <= i__4; ++i__) {
00380 a[ioff] = 0.;
00381 ioff += lda;
00382
00383 }
00384 ioff -= izero;
00385 i__4 = n;
00386 for (i__ = izero; i__ <= i__4; ++i__) {
00387 a[ioff + i__] = 0.;
00388
00389 }
00390 }
00391 } else {
00392 izero = 0;
00393 }
00394
00395
00396
00397 dlacpy_(uplo, &n, &n, &a[1], &lda, &asav[1], &lda);
00398
00399
00400
00401 if (zerot) {
00402 rcondc = 0.;
00403 } else {
00404
00405
00406
00407 anorm = dlansy_("1", uplo, &n, &a[1], &lda, &
00408 d_work_dlansy__[1]);
00409
00410
00411
00412 dpotrf_(uplo, &n, &a[1], &lda, &info);
00413
00414
00415
00416 dpotri_(uplo, &n, &a[1], &lda, &info);
00417
00418
00419
00420 ainvnm = dlansy_("1", uplo, &n, &a[1], &lda, &
00421 d_work_dlansy__[1]);
00422 rcondc = 1. / anorm / ainvnm;
00423
00424
00425
00426 dlacpy_(uplo, &n, &n, &asav[1], &lda, &a[1], &lda);
00427
00428 }
00429
00430
00431
00432 s_copy(srnamc_1.srnamt, "DLARHS", (ftnlen)32, (ftnlen)
00433 6);
00434 dlarhs_("DPO", "N", uplo, " ", &n, &n, &kl, &ku, &
00435 nrhs, &a[1], &lda, &xact[1], &lda, &b[1], &
00436 lda, iseed, &info);
00437 dlacpy_("Full", &n, &nrhs, &b[1], &lda, &bsav[1], &
00438 lda);
00439
00440
00441
00442
00443 dlacpy_(uplo, &n, &n, &a[1], &lda, &afac[1], &lda);
00444 dlacpy_("Full", &n, &nrhs, &b[1], &ldb, &x[1], &ldb);
00445
00446 s_copy(srnamc_1.srnamt, "DTRTTF", (ftnlen)32, (ftnlen)
00447 6);
00448 dtrttf_(cform, uplo, &n, &afac[1], &lda, &arf[1], &
00449 info);
00450 s_copy(srnamc_1.srnamt, "DPFTRF", (ftnlen)32, (ftnlen)
00451 6);
00452 dpftrf_(cform, uplo, &n, &arf[1], &info);
00453
00454
00455
00456 if (info != izero) {
00457
00458
00459
00460
00461
00462 alaerh_("DPF", "DPFSV ", &info, &izero, uplo, &n,
00463 &n, &c_n1, &c_n1, &nrhs, &iit, &nfail, &
00464 nerrs, nout);
00465 goto L100;
00466 }
00467
00468
00469
00470 if (info != 0) {
00471 goto L100;
00472 }
00473
00474 s_copy(srnamc_1.srnamt, "DPFTRS", (ftnlen)32, (ftnlen)
00475 6);
00476 dpftrs_(cform, uplo, &n, &nrhs, &arf[1], &x[1], &ldb,
00477 &info);
00478
00479 s_copy(srnamc_1.srnamt, "DTFTTR", (ftnlen)32, (ftnlen)
00480 6);
00481 dtfttr_(cform, uplo, &n, &arf[1], &afac[1], &lda, &
00482 info);
00483
00484
00485
00486
00487 dlacpy_(uplo, &n, &n, &afac[1], &lda, &asav[1], &lda);
00488 dpot01_(uplo, &n, &a[1], &lda, &afac[1], &lda, &
00489 d_work_dpot01__[1], result);
00490 dlacpy_(uplo, &n, &n, &asav[1], &lda, &afac[1], &lda);
00491
00492
00493
00494 if (n % 2 == 0) {
00495 i__4 = n + 1;
00496 i__5 = n / 2;
00497 i__6 = n + 1;
00498 i__7 = n + 1;
00499 dlacpy_("A", &i__4, &i__5, &arf[1], &i__6, &
00500 arfinv[1], &i__7);
00501 } else {
00502 i__4 = (n + 1) / 2;
00503 dlacpy_("A", &n, &i__4, &arf[1], &n, &arfinv[1], &
00504 n);
00505 }
00506
00507 s_copy(srnamc_1.srnamt, "DPFTRI", (ftnlen)32, (ftnlen)
00508 6);
00509 dpftri_(cform, uplo, &n, &arfinv[1], &info);
00510
00511 s_copy(srnamc_1.srnamt, "DTFTTR", (ftnlen)32, (ftnlen)
00512 6);
00513 dtfttr_(cform, uplo, &n, &arfinv[1], &ainv[1], &lda, &
00514 info);
00515
00516
00517
00518 if (info != 0) {
00519 alaerh_("DPO", "DPFTRI", &info, &c__0, uplo, &n, &
00520 n, &c_n1, &c_n1, &c_n1, &imat, &nfail, &
00521 nerrs, nout);
00522 }
00523
00524 dpot03_(uplo, &n, &a[1], &lda, &ainv[1], &lda, &
00525 d_temp_dpot03__[1], &lda, &d_work_dpot03__[1],
00526 &rcondc, &result[1]);
00527
00528
00529
00530 dlacpy_("Full", &n, &nrhs, &b[1], &lda, &
00531 d_temp_dpot02__[1], &lda);
00532 dpot02_(uplo, &n, &nrhs, &a[1], &lda, &x[1], &lda, &
00533 d_temp_dpot02__[1], &lda, &d_work_dpot02__[1],
00534 &result[2]);
00535
00536
00537 dget04_(&n, &nrhs, &x[1], &lda, &xact[1], &lda, &
00538 rcondc, &result[3]);
00539 nt = 4;
00540
00541
00542
00543
00544 i__4 = nt;
00545 for (k = 1; k <= i__4; ++k) {
00546 if (result[k - 1] >= *thresh) {
00547 if (nfail == 0 && nerrs == 0) {
00548 aladhd_(nout, "DPF");
00549 }
00550 io___37.ciunit = *nout;
00551 s_wsfe(&io___37);
00552 do_fio(&c__1, "DPFSV ", (ftnlen)6);
00553 do_fio(&c__1, uplo, (ftnlen)1);
00554 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00555 integer));
00556 do_fio(&c__1, (char *)&iit, (ftnlen)sizeof(
00557 integer));
00558 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00559 integer));
00560 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00561 sizeof(doublereal));
00562 e_wsfe();
00563 ++nfail;
00564 }
00565
00566 }
00567 nrun += nt;
00568 L100:
00569 ;
00570 }
00571
00572 }
00573 L120:
00574 ;
00575 }
00576
00577 }
00578
00579 }
00580
00581
00582
00583 alasvm_("DPF", nout, &nfail, &nrun, &nerrs);
00584
00585
00586 return 0;
00587
00588
00589
00590 }