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 doublereal c_b17 = 0.;
00036 static integer c__1 = 1;
00037
00038 int ddrvab_(logical *dotype, integer *nm, integer *mval,
00039 integer *nns, integer *nsval, doublereal *thresh, integer *nmax,
00040 doublereal *a, doublereal *afac, doublereal *b, doublereal *x,
00041 doublereal *work, doublereal *rwork, real *swork, integer *iwork,
00042 integer *nout)
00043 {
00044
00045
00046 static integer iseedy[4] = { 2006,2007,2008,2009 };
00047
00048
00049 static char fmt_9988[] = "(\002 *** \002,a6,\002 returned with INFO ="
00050 "\002,i5,\002 instead of \002,i5,/\002 ==> M =\002,i5,\002, type"
00051 " \002,i2)";
00052 static char fmt_9975[] = "(\002 *** Error code from \002,a6,\002=\002,"
00053 "i5,\002 for M=\002,i5,\002, type \002,i2)";
00054 static char fmt_8999[] = "(/1x,a3,\002: General dense matrices\002)";
00055 static char fmt_8979[] = "(4x,\0021. Diagonal\002,24x,\0027. Last n/2 co"
00056 "lumns zero\002,/4x,\0022. Upper triangular\002,16x,\0028. Random"
00057 ", CNDNUM = sqrt(0.1/EPS)\002,/4x,\0023. Lower triangular\002,16x,"
00058 "\0029. Random, CNDNUM = 0.1/EPS\002,/4x,\0024. Random, CNDNUM = 2"
00059 "\002,13x,\00210. Scaled near underflow\002,/4x,\0025. First colu"
00060 "mn zero\002,14x,\00211. Scaled near overflow\002,/4x,\0026. Last"
00061 " column zero\002)";
00062 static char fmt_8960[] = "(3x,i2,\002: norm_1( B - A * X ) / \002,\002("
00063 " norm_1(A) * norm_1(X) * EPS * SQRT(N) ) > 1 if ITERREF\002,/4x"
00064 ",\002or norm_1( B - A * X ) / \002,\002( norm_1(A) * norm_1(X) "
00065 "* EPS ) > THRES if DGETRF\002)";
00066 static char fmt_9998[] = "(\002 TRANS='\002,a1,\002', N =\002,i5,\002, N"
00067 "RHS=\002,i3,\002, type \002,i2,\002, test(\002,i2,\002) =\002,g1"
00068 "2.5)";
00069 static char fmt_9996[] = "(1x,a6,\002: \002,i6,\002 out of \002,i6,\002 "
00070 "tests failed to pass the threshold\002)";
00071 static char fmt_9995[] = "(/1x,\002All tests for \002,a6,\002 routines p"
00072 "assed the threshold (\002,i6,\002 tests run)\002)";
00073 static char fmt_9994[] = "(6x,i6,\002 error messages recorded\002)";
00074
00075
00076 integer i__1, i__2, i__3;
00077 cilist ci__1;
00078
00079
00080 int s_copy(char *, char *, ftnlen, ftnlen);
00081 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00082 double sqrt(doublereal);
00083
00084
00085 integer i__, m, n, im, kl, ku, lda, ioff, mode, kase, imat, info;
00086 char path[3], dist[1];
00087 integer irhs, iter, nrhs;
00088 char type__[1];
00089 integer nrun;
00090 extern int alahd_(integer *, char *);
00091 integer nfail, iseed[4];
00092 extern int dget08_(char *, integer *, integer *, integer
00093 *, doublereal *, integer *, doublereal *, integer *, doublereal *,
00094 integer *, doublereal *, doublereal *);
00095 integer nimat;
00096 doublereal anorm;
00097 char trans[1];
00098 integer izero, nerrs;
00099 logical zerot;
00100 char xtype[1];
00101 extern int dlatb4_(char *, integer *, integer *, integer
00102 *, char *, integer *, integer *, doublereal *, integer *,
00103 doublereal *, char *), alaerh_(char *,
00104 char *, integer *, integer *, char *, integer *, integer *,
00105 integer *, integer *, integer *, integer *, integer *, integer *,
00106 integer *), dlacpy_(char *, integer *,
00107 integer *, doublereal *, integer *, doublereal *, integer *), dlarhs_(char *, char *, char *, char *, integer *,
00108 integer *, integer *, integer *, integer *, doublereal *, integer
00109 *, doublereal *, integer *, doublereal *, integer *, integer *,
00110 integer *), dlaset_(char *,
00111 integer *, integer *, doublereal *, doublereal *, doublereal *,
00112 integer *);
00113 doublereal cndnum;
00114 extern int dlatms_(integer *, integer *, char *, integer
00115 *, char *, doublereal *, integer *, doublereal *, doublereal *,
00116 integer *, integer *, char *, doublereal *, integer *, doublereal
00117 *, integer *), dsgesv_(integer *, integer
00118 *, doublereal *, integer *, integer *, doublereal *, integer *,
00119 doublereal *, integer *, doublereal *, real *, integer *, integer
00120 *);
00121 doublereal result[1];
00122
00123
00124 static cilist io___31 = { 0, 0, 0, fmt_9988, 0 };
00125 static cilist io___32 = { 0, 0, 0, fmt_9975, 0 };
00126 static cilist io___34 = { 0, 0, 0, fmt_8999, 0 };
00127 static cilist io___35 = { 0, 0, 0, fmt_8979, 0 };
00128 static cilist io___36 = { 0, 0, 0, fmt_8960, 0 };
00129 static cilist io___37 = { 0, 0, 0, fmt_9998, 0 };
00130 static cilist io___38 = { 0, 0, 0, fmt_9996, 0 };
00131 static cilist io___39 = { 0, 0, 0, fmt_9995, 0 };
00132 static cilist io___40 = { 0, 0, 0, fmt_9994, 0 };
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 --iwork;
00224 --swork;
00225 --rwork;
00226 --work;
00227 --x;
00228 --b;
00229 --afac;
00230 --a;
00231 --nsval;
00232 --mval;
00233 --dotype;
00234
00235
00236
00237
00238
00239
00240
00241 kase = 0;
00242 s_copy(path, "Double precision", (ftnlen)1, (ftnlen)16);
00243 s_copy(path + 1, "GE", (ftnlen)2, (ftnlen)2);
00244 nrun = 0;
00245 nfail = 0;
00246 nerrs = 0;
00247 for (i__ = 1; i__ <= 4; ++i__) {
00248 iseed[i__ - 1] = iseedy[i__ - 1];
00249
00250 }
00251
00252 infoc_1.infot = 0;
00253
00254
00255
00256 i__1 = *nm;
00257 for (im = 1; im <= i__1; ++im) {
00258 m = mval[im];
00259 lda = max(1,m);
00260
00261 n = m;
00262 nimat = 11;
00263 if (m <= 0 || n <= 0) {
00264 nimat = 1;
00265 }
00266
00267 i__2 = nimat;
00268 for (imat = 1; imat <= i__2; ++imat) {
00269
00270
00271
00272 if (! dotype[imat]) {
00273 goto L100;
00274 }
00275
00276
00277
00278 zerot = imat >= 5 && imat <= 7;
00279 if (zerot && n < imat - 4) {
00280 goto L100;
00281 }
00282
00283
00284
00285
00286 dlatb4_(path, &imat, &m, &n, type__, &kl, &ku, &anorm, &mode, &
00287 cndnum, dist);
00288
00289 s_copy(srnamc_1.srnamt, "DLATMS", (ftnlen)32, (ftnlen)6);
00290 dlatms_(&m, &n, dist, iseed, type__, &rwork[1], &mode, &cndnum, &
00291 anorm, &kl, &ku, "No packing", &a[1], &lda, &work[1], &
00292 info);
00293
00294
00295
00296 if (info != 0) {
00297 alaerh_(path, "DLATMS", &info, &c__0, " ", &m, &n, &c_n1, &
00298 c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00299 goto L100;
00300 }
00301
00302
00303
00304
00305 if (zerot) {
00306 if (imat == 5) {
00307 izero = 1;
00308 } else if (imat == 6) {
00309 izero = min(m,n);
00310 } else {
00311 izero = min(m,n) / 2 + 1;
00312 }
00313 ioff = (izero - 1) * lda;
00314 if (imat < 7) {
00315 i__3 = m;
00316 for (i__ = 1; i__ <= i__3; ++i__) {
00317 a[ioff + i__] = 0.;
00318
00319 }
00320 } else {
00321 i__3 = n - izero + 1;
00322 dlaset_("Full", &m, &i__3, &c_b17, &c_b17, &a[ioff + 1], &
00323 lda);
00324 }
00325 } else {
00326 izero = 0;
00327 }
00328
00329 i__3 = *nns;
00330 for (irhs = 1; irhs <= i__3; ++irhs) {
00331 nrhs = nsval[irhs];
00332 *(unsigned char *)xtype = 'N';
00333 *(unsigned char *)trans = 'N';
00334
00335 s_copy(srnamc_1.srnamt, "DLARHS", (ftnlen)32, (ftnlen)6);
00336 dlarhs_(path, xtype, " ", trans, &n, &n, &kl, &ku, &nrhs, &a[
00337 1], &lda, &x[1], &lda, &b[1], &lda, iseed, &info);
00338
00339 s_copy(srnamc_1.srnamt, "DSGESV", (ftnlen)32, (ftnlen)6);
00340
00341 ++kase;
00342
00343 dlacpy_("Full", &m, &n, &a[1], &lda, &afac[1], &lda);
00344
00345 dsgesv_(&n, &nrhs, &a[1], &lda, &iwork[1], &b[1], &lda, &x[1],
00346 &lda, &work[1], &swork[1], &iter, &info);
00347
00348 if (iter < 0) {
00349 dlacpy_("Full", &m, &n, &afac[1], &lda, &a[1], &lda);
00350 }
00351
00352
00353
00354
00355 if (info != izero) {
00356
00357 if (nfail == 0 && nerrs == 0) {
00358 alahd_(nout, path);
00359 }
00360 ++nerrs;
00361
00362 if (info != izero && izero != 0) {
00363 io___31.ciunit = *nout;
00364 s_wsfe(&io___31);
00365 do_fio(&c__1, "DSGESV", (ftnlen)6);
00366 do_fio(&c__1, (char *)&info, (ftnlen)sizeof(integer));
00367 do_fio(&c__1, (char *)&izero, (ftnlen)sizeof(integer))
00368 ;
00369 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00370 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00371 e_wsfe();
00372 } else {
00373 io___32.ciunit = *nout;
00374 s_wsfe(&io___32);
00375 do_fio(&c__1, "DSGESV", (ftnlen)6);
00376 do_fio(&c__1, (char *)&info, (ftnlen)sizeof(integer));
00377 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00378 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00379 e_wsfe();
00380 }
00381 }
00382
00383
00384
00385 if (info != 0) {
00386 goto L100;
00387 }
00388
00389
00390
00391 dlacpy_("Full", &n, &nrhs, &b[1], &lda, &work[1], &lda);
00392
00393 dget08_(trans, &n, &n, &nrhs, &a[1], &lda, &x[1], &lda, &work[
00394 1], &lda, &rwork[1], result);
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408 if (*thresh <= 0.f || iter >= 0 && n > 0 && result[0] >= sqrt(
00409 (doublereal) n) || iter < 0 && result[0] >= *thresh) {
00410
00411 if (nfail == 0 && nerrs == 0) {
00412 io___34.ciunit = *nout;
00413 s_wsfe(&io___34);
00414 do_fio(&c__1, "DGE", (ftnlen)3);
00415 e_wsfe();
00416 ci__1.cierr = 0;
00417 ci__1.ciunit = *nout;
00418 ci__1.cifmt = "( ' Matrix types:' )";
00419 s_wsfe(&ci__1);
00420 e_wsfe();
00421 io___35.ciunit = *nout;
00422 s_wsfe(&io___35);
00423 e_wsfe();
00424 ci__1.cierr = 0;
00425 ci__1.ciunit = *nout;
00426 ci__1.cifmt = "( ' Test ratios:' )";
00427 s_wsfe(&ci__1);
00428 e_wsfe();
00429 io___36.ciunit = *nout;
00430 s_wsfe(&io___36);
00431 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00432 e_wsfe();
00433 ci__1.cierr = 0;
00434 ci__1.ciunit = *nout;
00435 ci__1.cifmt = "( ' Messages:' )";
00436 s_wsfe(&ci__1);
00437 e_wsfe();
00438 }
00439
00440 io___37.ciunit = *nout;
00441 s_wsfe(&io___37);
00442 do_fio(&c__1, trans, (ftnlen)1);
00443 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00444 do_fio(&c__1, (char *)&nrhs, (ftnlen)sizeof(integer));
00445 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00446 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00447 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(
00448 doublereal));
00449 e_wsfe();
00450 ++nfail;
00451 }
00452 ++nrun;
00453
00454 }
00455 L100:
00456 ;
00457 }
00458
00459 }
00460
00461
00462
00463 if (nfail > 0) {
00464 io___38.ciunit = *nout;
00465 s_wsfe(&io___38);
00466 do_fio(&c__1, "DSGESV", (ftnlen)6);
00467 do_fio(&c__1, (char *)&nfail, (ftnlen)sizeof(integer));
00468 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00469 e_wsfe();
00470 } else {
00471 io___39.ciunit = *nout;
00472 s_wsfe(&io___39);
00473 do_fio(&c__1, "DSGESV", (ftnlen)6);
00474 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00475 e_wsfe();
00476 }
00477 if (nerrs > 0) {
00478 io___40.ciunit = *nout;
00479 s_wsfe(&io___40);
00480 do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00481 e_wsfe();
00482 }
00483
00484
00485
00486
00487
00488
00489
00490 return 0;
00491
00492
00493
00494 }