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__2 = 2;
00034 static integer c__0 = 0;
00035 static integer c_n1 = -1;
00036 static integer c__1 = 1;
00037 static integer c__3 = 3;
00038
00039 int cchkrq_(logical *dotype, integer *nm, integer *mval,
00040 integer *nn, integer *nval, integer *nnb, integer *nbval, integer *
00041 nxval, integer *nrhs, real *thresh, logical *tsterr, integer *nmax,
00042 complex *a, complex *af, complex *aq, complex *ar, complex *ac,
00043 complex *b, complex *x, complex *xact, complex *tau, complex *work,
00044 real *rwork, integer *iwork, integer *nout)
00045 {
00046
00047
00048 static integer iseedy[4] = { 1988,1989,1990,1991 };
00049
00050
00051 static char fmt_9999[] = "(\002 M=\002,i5,\002, N=\002,i5,\002, K=\002,i"
00052 "5,\002, NB=\002,i4,\002, NX=\002,i5,\002, type \002,i2,\002, tes"
00053 "t(\002,i2,\002)=\002,g12.5)";
00054
00055
00056 integer i__1, i__2, i__3, i__4, i__5;
00057
00058
00059 int s_copy(char *, char *, ftnlen, ftnlen);
00060 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00061
00062
00063 integer i__, k, m, n, nb, ik, im, in, kl, nk, ku, nt, nx, lda, inb, mode,
00064 imat, info;
00065 char path[3];
00066 integer kval[4];
00067 char dist[1], type__[1];
00068 integer nrun;
00069 extern int alahd_(integer *, char *), cget02_(
00070 char *, integer *, integer *, integer *, complex *, integer *,
00071 complex *, integer *, complex *, integer *, real *, real *);
00072 integer nfail, iseed[4];
00073 extern int crqt01_(integer *, integer *, complex *,
00074 complex *, complex *, complex *, integer *, complex *, complex *,
00075 integer *, real *, real *), crqt02_(integer *, integer *, integer
00076 *, complex *, complex *, complex *, complex *, integer *, complex
00077 *, complex *, integer *, real *, real *);
00078 real anorm;
00079 extern int crqt03_(integer *, integer *, integer *,
00080 complex *, complex *, complex *, complex *, integer *, complex *,
00081 complex *, integer *, real *, real *);
00082 integer minmn, nerrs, lwork;
00083 extern int clatb4_(char *, integer *, integer *, integer
00084 *, char *, integer *, integer *, real *, integer *, real *, char *
00085 ), alaerh_(char *, char *, integer *,
00086 integer *, char *, integer *, integer *, integer *, integer *,
00087 integer *, integer *, integer *, integer *, integer *);
00088 extern logical cgennd_(integer *, integer *, complex *, integer *);
00089 extern int clacpy_(char *, integer *, integer *, complex
00090 *, integer *, complex *, integer *), clarhs_(char *, char
00091 *, char *, char *, integer *, integer *, integer *, integer *,
00092 integer *, complex *, integer *, complex *, integer *, complex *,
00093 integer *, integer *, integer *),
00094 alasum_(char *, integer *, integer *, integer *, integer *);
00095 real cndnum;
00096 extern int cgerqs_(integer *, integer *, integer *,
00097 complex *, integer *, complex *, complex *, integer *, complex *,
00098 integer *, integer *), clatms_(integer *, integer *, char *,
00099 integer *, char *, real *, integer *, real *, real *, integer *,
00100 integer *, char *, complex *, integer *, complex *, integer *), cerrrq_(char *, integer *),
00101 xlaenv_(integer *, integer *);
00102 real result[8];
00103
00104
00105 static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
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 --iwork;
00218 --rwork;
00219 --work;
00220 --tau;
00221 --xact;
00222 --x;
00223 --b;
00224 --ac;
00225 --ar;
00226 --aq;
00227 --af;
00228 --a;
00229 --nxval;
00230 --nbval;
00231 --nval;
00232 --mval;
00233 --dotype;
00234
00235
00236
00237
00238
00239
00240
00241 s_copy(path, "Complex precision", (ftnlen)1, (ftnlen)17);
00242 s_copy(path + 1, "RQ", (ftnlen)2, (ftnlen)2);
00243 nrun = 0;
00244 nfail = 0;
00245 nerrs = 0;
00246 for (i__ = 1; i__ <= 4; ++i__) {
00247 iseed[i__ - 1] = iseedy[i__ - 1];
00248
00249 }
00250
00251
00252
00253 if (*tsterr) {
00254 cerrrq_(path, nout);
00255 }
00256 infoc_1.infot = 0;
00257 xlaenv_(&c__2, &c__2);
00258
00259 lda = *nmax;
00260 lwork = *nmax * max(*nmax,*nrhs);
00261
00262
00263
00264 i__1 = *nm;
00265 for (im = 1; im <= i__1; ++im) {
00266 m = mval[im];
00267
00268
00269
00270 i__2 = *nn;
00271 for (in = 1; in <= i__2; ++in) {
00272 n = nval[in];
00273 minmn = min(m,n);
00274 for (imat = 1; imat <= 8; ++imat) {
00275
00276
00277
00278 if (! dotype[imat]) {
00279 goto L50;
00280 }
00281
00282
00283
00284
00285 clatb4_(path, &imat, &m, &n, type__, &kl, &ku, &anorm, &mode,
00286 &cndnum, dist);
00287
00288 s_copy(srnamc_1.srnamt, "CLATMS", (ftnlen)32, (ftnlen)6);
00289 clatms_(&m, &n, dist, iseed, type__, &rwork[1], &mode, &
00290 cndnum, &anorm, &kl, &ku, "No packing", &a[1], &lda, &
00291 work[1], &info);
00292
00293
00294
00295 if (info != 0) {
00296 alaerh_(path, "CLATMS", &info, &c__0, " ", &m, &n, &c_n1,
00297 &c_n1, &c_n1, &imat, &nfail, &nerrs, nout);
00298 goto L50;
00299 }
00300
00301
00302
00303
00304
00305 kval[0] = minmn;
00306 kval[1] = 0;
00307 kval[2] = 1;
00308 kval[3] = minmn / 2;
00309 if (minmn == 0) {
00310 nk = 1;
00311 } else if (minmn == 1) {
00312 nk = 2;
00313 } else if (minmn <= 3) {
00314 nk = 3;
00315 } else {
00316 nk = 4;
00317 }
00318
00319
00320
00321 i__3 = nk;
00322 for (ik = 1; ik <= i__3; ++ik) {
00323 k = kval[ik - 1];
00324
00325
00326
00327 i__4 = *nnb;
00328 for (inb = 1; inb <= i__4; ++inb) {
00329 nb = nbval[inb];
00330 xlaenv_(&c__1, &nb);
00331 nx = nxval[inb];
00332 xlaenv_(&c__3, &nx);
00333 for (i__ = 1; i__ <= 8; ++i__) {
00334 result[i__ - 1] = 0.f;
00335 }
00336 nt = 2;
00337 if (ik == 1) {
00338
00339
00340
00341 crqt01_(&m, &n, &a[1], &af[1], &aq[1], &ar[1], &
00342 lda, &tau[1], &work[1], &lwork, &rwork[1],
00343 result);
00344 if (m <= n) {
00345
00346 if (! cgennd_(&m, &m, &af[lda * (n - m) + 1],
00347 &lda)) {
00348 result[7] = *thresh * 2;
00349 }
00350 } else {
00351
00352 i__ = m - n;
00353 if (! cgennd_(&n, &n, &af[i__ + 1], &lda)) {
00354 result[7] = *thresh * 2;
00355 }
00356 }
00357 } else if (m <= n) {
00358
00359
00360
00361
00362 crqt02_(&m, &n, &k, &a[1], &af[1], &aq[1], &ar[1],
00363 &lda, &tau[1], &work[1], &lwork, &rwork[
00364 1], result);
00365 } else {
00366 result[0] = 0.f;
00367 result[1] = 0.f;
00368 }
00369 if (m >= k) {
00370
00371
00372
00373
00374 crqt03_(&m, &n, &k, &af[1], &ac[1], &ar[1], &aq[1]
00375 , &lda, &tau[1], &work[1], &lwork, &rwork[
00376 1], &result[2]);
00377 nt += 4;
00378
00379
00380
00381
00382
00383 if (k == m && inb == 1) {
00384
00385
00386
00387
00388 s_copy(srnamc_1.srnamt, "CLARHS", (ftnlen)32,
00389 (ftnlen)6);
00390 clarhs_(path, "New", "Full", "No transpose", &
00391 m, &n, &c__0, &c__0, nrhs, &a[1], &
00392 lda, &xact[1], &lda, &b[1], &lda,
00393 iseed, &info);
00394
00395 clacpy_("Full", &m, nrhs, &b[1], &lda, &x[n -
00396 m + 1], &lda);
00397 s_copy(srnamc_1.srnamt, "CGERQS", (ftnlen)32,
00398 (ftnlen)6);
00399 cgerqs_(&m, &n, nrhs, &af[1], &lda, &tau[1], &
00400 x[1], &lda, &work[1], &lwork, &info);
00401
00402
00403
00404 if (info != 0) {
00405 alaerh_(path, "CGERQS", &info, &c__0,
00406 " ", &m, &n, nrhs, &c_n1, &nb, &
00407 imat, &nfail, &nerrs, nout);
00408 }
00409
00410 cget02_("No transpose", &m, &n, nrhs, &a[1], &
00411 lda, &x[1], &lda, &b[1], &lda, &rwork[
00412 1], &result[6]);
00413 ++nt;
00414 } else {
00415 result[6] = 0.f;
00416 }
00417 } else {
00418 result[2] = 0.f;
00419 result[3] = 0.f;
00420 result[4] = 0.f;
00421 result[5] = 0.f;
00422 }
00423
00424
00425
00426
00427 i__5 = nt;
00428 for (i__ = 1; i__ <= i__5; ++i__) {
00429 if (result[i__ - 1] >= *thresh) {
00430 if (nfail == 0 && nerrs == 0) {
00431 alahd_(nout, path);
00432 }
00433 io___33.ciunit = *nout;
00434 s_wsfe(&io___33);
00435 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(
00436 integer));
00437 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00438 integer));
00439 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00440 integer));
00441 do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(
00442 integer));
00443 do_fio(&c__1, (char *)&nx, (ftnlen)sizeof(
00444 integer));
00445 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00446 integer));
00447 do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(
00448 integer));
00449 do_fio(&c__1, (char *)&result[i__ - 1], (
00450 ftnlen)sizeof(real));
00451 e_wsfe();
00452 ++nfail;
00453 }
00454
00455 }
00456 nrun += nt;
00457
00458 }
00459
00460 }
00461 L50:
00462 ;
00463 }
00464
00465 }
00466
00467 }
00468
00469
00470
00471 alasum_(path, nout, &nfail, &nrun, &nerrs);
00472
00473 return 0;
00474
00475
00476
00477 }