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 doublecomplex c_b17 = {0.,0.};
00036 static integer c__1 = 1;
00037
00038 int zdrvab_(logical *dotype, integer *nm, integer *mval,
00039 integer *nns, integer *nsval, doublereal *thresh, integer *nmax,
00040 doublecomplex *a, doublecomplex *afac, doublecomplex *b,
00041 doublecomplex *x, doublecomplex *work, doublereal *rwork, complex *
00042 swork, integer *iwork, 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, i__4;
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], nimat;
00092 doublereal anorm;
00093 extern int zget08_(char *, integer *, integer *, integer
00094 *, doublecomplex *, integer *, doublecomplex *, integer *,
00095 doublecomplex *, integer *, doublereal *, doublereal *);
00096 char trans[1];
00097 integer izero, nerrs;
00098 logical zerot;
00099 char xtype[1];
00100 extern int zlatb4_(char *, integer *, integer *, integer
00101 *, char *, integer *, integer *, doublereal *, integer *,
00102 doublereal *, char *), alaerh_(char *,
00103 char *, integer *, integer *, char *, integer *, integer *,
00104 integer *, integer *, integer *, integer *, integer *, integer *,
00105 integer *);
00106 doublereal cndnum;
00107 extern int zcgesv_(integer *, integer *, doublecomplex *,
00108 integer *, integer *, doublecomplex *, integer *, doublecomplex *
00109 , integer *, doublecomplex *, complex *, doublereal *, integer *,
00110 integer *), zlacpy_(char *, integer *, integer *, doublecomplex *,
00111 integer *, doublecomplex *, integer *), zlarhs_(char *,
00112 char *, char *, char *, integer *, integer *, integer *, integer *
00113 , integer *, doublecomplex *, integer *, doublecomplex *, integer
00114 *, doublecomplex *, integer *, integer *, integer *), zlaset_(char *, integer *, integer *,
00115 doublecomplex *, doublecomplex *, doublecomplex *, integer *), zlatms_(integer *, integer *, char *, integer *, char *,
00116 doublereal *, integer *, doublereal *, doublereal *, integer *,
00117 integer *, char *, doublecomplex *, integer *, doublecomplex *,
00118 integer *);
00119 doublereal result[1];
00120
00121
00122 static cilist io___31 = { 0, 0, 0, fmt_9988, 0 };
00123 static cilist io___32 = { 0, 0, 0, fmt_9975, 0 };
00124 static cilist io___34 = { 0, 0, 0, fmt_8999, 0 };
00125 static cilist io___35 = { 0, 0, 0, fmt_8979, 0 };
00126 static cilist io___36 = { 0, 0, 0, fmt_8960, 0 };
00127 static cilist io___37 = { 0, 0, 0, fmt_9998, 0 };
00128 static cilist io___38 = { 0, 0, 0, fmt_9996, 0 };
00129 static cilist io___39 = { 0, 0, 0, fmt_9995, 0 };
00130 static cilist io___40 = { 0, 0, 0, fmt_9994, 0 };
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 --iwork;
00222 --swork;
00223 --rwork;
00224 --work;
00225 --x;
00226 --b;
00227 --afac;
00228 --a;
00229 --nsval;
00230 --mval;
00231 --dotype;
00232
00233
00234
00235
00236
00237
00238
00239 kase = 0;
00240 s_copy(path, "Zomplex precision", (ftnlen)1, (ftnlen)17);
00241 s_copy(path + 1, "GE", (ftnlen)2, (ftnlen)2);
00242 nrun = 0;
00243 nfail = 0;
00244 nerrs = 0;
00245 for (i__ = 1; i__ <= 4; ++i__) {
00246 iseed[i__ - 1] = iseedy[i__ - 1];
00247
00248 }
00249
00250 infoc_1.infot = 0;
00251
00252
00253
00254 i__1 = *nm;
00255 for (im = 1; im <= i__1; ++im) {
00256 m = mval[im];
00257 lda = max(1,m);
00258
00259 n = m;
00260 nimat = 11;
00261 if (m <= 0 || n <= 0) {
00262 nimat = 1;
00263 }
00264
00265 i__2 = nimat;
00266 for (imat = 1; imat <= i__2; ++imat) {
00267
00268
00269
00270 if (! dotype[imat]) {
00271 goto L100;
00272 }
00273
00274
00275
00276 zerot = imat >= 5 && imat <= 7;
00277 if (zerot && n < imat - 4) {
00278 goto L100;
00279 }
00280
00281
00282
00283
00284 zlatb4_(path, &imat, &m, &n, type__, &kl, &ku, &anorm, &mode, &
00285 cndnum, dist);
00286
00287 s_copy(srnamc_1.srnamt, "ZLATMS", (ftnlen)32, (ftnlen)6);
00288 zlatms_(&m, &n, dist, iseed, type__, &rwork[1], &mode, &cndnum, &
00289 anorm, &kl, &ku, "No packing", &a[1], &lda, &work[1], &
00290 info);
00291
00292
00293
00294 if (info != 0) {
00295 alaerh_(path, "ZLATMS", &info, &c__0, " ", &m, &n, &c_n1, &
00296 c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00297 goto L100;
00298 }
00299
00300
00301
00302
00303 if (zerot) {
00304 if (imat == 5) {
00305 izero = 1;
00306 } else if (imat == 6) {
00307 izero = min(m,n);
00308 } else {
00309 izero = min(m,n) / 2 + 1;
00310 }
00311 ioff = (izero - 1) * lda;
00312 if (imat < 7) {
00313 i__3 = m;
00314 for (i__ = 1; i__ <= i__3; ++i__) {
00315 i__4 = ioff + i__;
00316 a[i__4].r = 0., a[i__4].i = 0.;
00317
00318 }
00319 } else {
00320 i__3 = n - izero + 1;
00321 zlaset_("Full", &m, &i__3, &c_b17, &c_b17, &a[ioff + 1], &
00322 lda);
00323 }
00324 } else {
00325 izero = 0;
00326 }
00327
00328 i__3 = *nns;
00329 for (irhs = 1; irhs <= i__3; ++irhs) {
00330 nrhs = nsval[irhs];
00331 *(unsigned char *)xtype = 'N';
00332 *(unsigned char *)trans = 'N';
00333
00334 s_copy(srnamc_1.srnamt, "ZLARHS", (ftnlen)32, (ftnlen)6);
00335 zlarhs_(path, xtype, " ", trans, &n, &n, &kl, &ku, &nrhs, &a[
00336 1], &lda, &x[1], &lda, &b[1], &lda, iseed, &info);
00337
00338 s_copy(srnamc_1.srnamt, "ZCGESV", (ftnlen)32, (ftnlen)6);
00339
00340 ++kase;
00341
00342 zlacpy_("Full", &m, &n, &a[1], &lda, &afac[1], &lda);
00343
00344 zcgesv_(&n, &nrhs, &a[1], &lda, &iwork[1], &b[1], &lda, &x[1],
00345 &lda, &work[1], &swork[1], &rwork[1], &iter, &info);
00346
00347 if (iter < 0) {
00348 zlacpy_("Full", &m, &n, &afac[1], &lda, &a[1], &lda);
00349 }
00350
00351
00352
00353
00354 if (info != izero) {
00355
00356 if (nfail == 0 && nerrs == 0) {
00357 alahd_(nout, path);
00358 }
00359 ++nerrs;
00360
00361 if (info != izero && izero != 0) {
00362 io___31.ciunit = *nout;
00363 s_wsfe(&io___31);
00364 do_fio(&c__1, "ZCGESV", (ftnlen)6);
00365 do_fio(&c__1, (char *)&info, (ftnlen)sizeof(integer));
00366 do_fio(&c__1, (char *)&izero, (ftnlen)sizeof(integer))
00367 ;
00368 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00369 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00370 e_wsfe();
00371 } else {
00372 io___32.ciunit = *nout;
00373 s_wsfe(&io___32);
00374 do_fio(&c__1, "ZCGESV", (ftnlen)6);
00375 do_fio(&c__1, (char *)&info, (ftnlen)sizeof(integer));
00376 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00377 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00378 e_wsfe();
00379 }
00380 }
00381
00382
00383
00384 if (info != 0) {
00385 goto L100;
00386 }
00387
00388
00389
00390 zlacpy_("Full", &n, &nrhs, &b[1], &lda, &work[1], &lda);
00391
00392 zget08_(trans, &n, &n, &nrhs, &a[1], &lda, &x[1], &lda, &work[
00393 1], &lda, &rwork[1], result);
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407 if (*thresh <= 0.f || iter >= 0 && n > 0 && result[0] >= sqrt(
00408 (doublereal) n) || iter < 0 && result[0] >= *thresh) {
00409
00410 if (nfail == 0 && nerrs == 0) {
00411 io___34.ciunit = *nout;
00412 s_wsfe(&io___34);
00413 do_fio(&c__1, "DGE", (ftnlen)3);
00414 e_wsfe();
00415 ci__1.cierr = 0;
00416 ci__1.ciunit = *nout;
00417 ci__1.cifmt = "( ' Matrix types:' )";
00418 s_wsfe(&ci__1);
00419 e_wsfe();
00420 io___35.ciunit = *nout;
00421 s_wsfe(&io___35);
00422 e_wsfe();
00423 ci__1.cierr = 0;
00424 ci__1.ciunit = *nout;
00425 ci__1.cifmt = "( ' Test ratios:' )";
00426 s_wsfe(&ci__1);
00427 e_wsfe();
00428 io___36.ciunit = *nout;
00429 s_wsfe(&io___36);
00430 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00431 e_wsfe();
00432 ci__1.cierr = 0;
00433 ci__1.ciunit = *nout;
00434 ci__1.cifmt = "( ' Messages:' )";
00435 s_wsfe(&ci__1);
00436 e_wsfe();
00437 }
00438
00439 io___37.ciunit = *nout;
00440 s_wsfe(&io___37);
00441 do_fio(&c__1, trans, (ftnlen)1);
00442 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00443 do_fio(&c__1, (char *)&nrhs, (ftnlen)sizeof(integer));
00444 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00445 do_fio(&c__1, (char *)&c__1, (ftnlen)sizeof(integer));
00446 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(
00447 doublereal));
00448 e_wsfe();
00449 ++nfail;
00450 }
00451 ++nrun;
00452
00453 }
00454 L100:
00455 ;
00456 }
00457
00458 }
00459
00460
00461
00462 if (nfail > 0) {
00463 io___38.ciunit = *nout;
00464 s_wsfe(&io___38);
00465 do_fio(&c__1, "ZCGESV", (ftnlen)6);
00466 do_fio(&c__1, (char *)&nfail, (ftnlen)sizeof(integer));
00467 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00468 e_wsfe();
00469 } else {
00470 io___39.ciunit = *nout;
00471 s_wsfe(&io___39);
00472 do_fio(&c__1, "ZCGESV", (ftnlen)6);
00473 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00474 e_wsfe();
00475 }
00476 if (nerrs > 0) {
00477 io___40.ciunit = *nout;
00478 s_wsfe(&io___40);
00479 do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00480 e_wsfe();
00481 }
00482
00483
00484
00485
00486
00487
00488
00489 return 0;
00490
00491
00492
00493 }