00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static integer c__8 = 8;
00019 static integer c__1 = 1;
00020 static integer c__0 = 0;
00021
00022 int cckgqr_(integer *nm, integer *mval, integer *np, integer
00023 *pval, integer *nn, integer *nval, integer *nmats, integer *iseed,
00024 real *thresh, integer *nmax, complex *a, complex *af, complex *aq,
00025 complex *ar, complex *taua, complex *b, complex *bf, complex *bz,
00026 complex *bt, complex *bwk, complex *taub, complex *work, real *rwork,
00027 integer *nin, integer *nout, integer *info)
00028 {
00029
00030 static char fmt_9999[] = "(\002 CLATMS in CCKGQR: INFO = \002,i5)";
00031 static char fmt_9998[] = "(\002 M=\002,i4,\002 P=\002,i4,\002, N=\002,"
00032 "i4,\002, type \002,i2,\002, test \002,i2,\002, ratio=\002,g13.6)";
00033 static char fmt_9997[] = "(\002 N=\002,i4,\002 M=\002,i4,\002, P=\002,"
00034 "i4,\002, type \002,i2,\002, test \002,i2,\002, ratio=\002,g13.6)";
00035
00036
00037 integer i__1, i__2, i__3, i__4;
00038
00039
00040 int s_copy(char *, char *, ftnlen, ftnlen);
00041 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00042
00043
00044 integer i__, m, n, p, im, in, ip, nt, lda, ldb, kla, klb, kua, kub;
00045 char path[3];
00046 integer imat;
00047 char type__[1];
00048 integer nrun, modea, modeb, nfail;
00049 char dista[1], distb[1];
00050 integer iinfo;
00051 real anorm, bnorm;
00052 integer lwork;
00053 extern int slatb9_(char *, integer *, integer *, integer
00054 *, integer *, char *, integer *, integer *, integer *, integer *,
00055 real *, real *, integer *, integer *, real *, real *, char *,
00056 char *), alahdg_(integer *, char *
00057 );
00058 real cndnma, cndnmb;
00059 extern int alareq_(char *, integer *, logical *, integer
00060 *, integer *, integer *), alasum_(char *, integer *,
00061 integer *, integer *, integer *), clatms_(integer *,
00062 integer *, char *, integer *, char *, real *, integer *, real *,
00063 real *, integer *, integer *, char *, complex *, integer *,
00064 complex *, integer *), cgqrts_(integer *,
00065 integer *, integer *, complex *, complex *, complex *, complex *,
00066 integer *, complex *, complex *, complex *, complex *, complex *,
00067 complex *, integer *, complex *, complex *, integer *, real *,
00068 real *);
00069 logical dotype[8];
00070 extern int cgrqts_(integer *, integer *, integer *,
00071 complex *, complex *, complex *, complex *, integer *, complex *,
00072 complex *, complex *, complex *, complex *, complex *, integer *,
00073 complex *, complex *, integer *, real *, real *);
00074 logical firstt;
00075 real result[7];
00076
00077
00078 static cilist io___30 = { 0, 0, 0, fmt_9999, 0 };
00079 static cilist io___31 = { 0, 0, 0, fmt_9999, 0 };
00080 static cilist io___35 = { 0, 0, 0, fmt_9998, 0 };
00081 static cilist io___36 = { 0, 0, 0, fmt_9999, 0 };
00082 static cilist io___37 = { 0, 0, 0, fmt_9999, 0 };
00083 static cilist io___38 = { 0, 0, 0, fmt_9997, 0 };
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
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 --rwork;
00202 --work;
00203 --taub;
00204 --bwk;
00205 --bt;
00206 --bz;
00207 --bf;
00208 --b;
00209 --taua;
00210 --ar;
00211 --aq;
00212 --af;
00213 --a;
00214 --iseed;
00215 --nval;
00216 --pval;
00217 --mval;
00218
00219
00220 s_copy(path, "GQR", (ftnlen)3, (ftnlen)3);
00221 *info = 0;
00222 nrun = 0;
00223 nfail = 0;
00224 firstt = TRUE_;
00225 alareq_(path, nmats, dotype, &c__8, nin, nout);
00226 lda = *nmax;
00227 ldb = *nmax;
00228 lwork = *nmax * *nmax;
00229
00230
00231
00232 i__1 = *nm;
00233 for (im = 1; im <= i__1; ++im) {
00234 m = mval[im];
00235
00236
00237
00238 i__2 = *np;
00239 for (ip = 1; ip <= i__2; ++ip) {
00240 p = pval[ip];
00241
00242
00243
00244 i__3 = *nn;
00245 for (in = 1; in <= i__3; ++in) {
00246 n = nval[in];
00247
00248 for (imat = 1; imat <= 8; ++imat) {
00249
00250
00251
00252 if (! dotype[imat - 1]) {
00253 goto L30;
00254 }
00255
00256
00257
00258
00259
00260
00261 slatb9_("GRQ", &imat, &m, &p, &n, type__, &kla, &kua, &
00262 klb, &kub, &anorm, &bnorm, &modea, &modeb, &
00263 cndnma, &cndnmb, dista, distb);
00264
00265 clatms_(&m, &n, dista, &iseed[1], type__, &rwork[1], &
00266 modea, &cndnma, &anorm, &kla, &kua, "No packing",
00267 &a[1], &lda, &work[1], &iinfo);
00268 if (iinfo != 0) {
00269 io___30.ciunit = *nout;
00270 s_wsfe(&io___30);
00271 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00272 ;
00273 e_wsfe();
00274 *info = abs(iinfo);
00275 goto L30;
00276 }
00277
00278 clatms_(&p, &n, distb, &iseed[1], type__, &rwork[1], &
00279 modeb, &cndnmb, &bnorm, &klb, &kub, "No packing",
00280 &b[1], &ldb, &work[1], &iinfo);
00281 if (iinfo != 0) {
00282 io___31.ciunit = *nout;
00283 s_wsfe(&io___31);
00284 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00285 ;
00286 e_wsfe();
00287 *info = abs(iinfo);
00288 goto L30;
00289 }
00290
00291 nt = 4;
00292
00293 cgrqts_(&m, &p, &n, &a[1], &af[1], &aq[1], &ar[1], &lda, &
00294 taua[1], &b[1], &bf[1], &bz[1], &bt[1], &bwk[1], &
00295 ldb, &taub[1], &work[1], &lwork, &rwork[1],
00296 result);
00297
00298
00299
00300
00301 i__4 = nt;
00302 for (i__ = 1; i__ <= i__4; ++i__) {
00303 if (result[i__ - 1] >= *thresh) {
00304 if (nfail == 0 && firstt) {
00305 firstt = FALSE_;
00306 alahdg_(nout, "GRQ");
00307 }
00308 io___35.ciunit = *nout;
00309 s_wsfe(&io___35);
00310 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer))
00311 ;
00312 do_fio(&c__1, (char *)&p, (ftnlen)sizeof(integer))
00313 ;
00314 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00315 ;
00316 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00317 integer));
00318 do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(
00319 integer));
00320 do_fio(&c__1, (char *)&result[i__ - 1], (ftnlen)
00321 sizeof(real));
00322 e_wsfe();
00323 ++nfail;
00324 }
00325
00326 }
00327 nrun += nt;
00328
00329
00330
00331
00332
00333
00334 slatb9_("GQR", &imat, &m, &p, &n, type__, &kla, &kua, &
00335 klb, &kub, &anorm, &bnorm, &modea, &modeb, &
00336 cndnma, &cndnmb, dista, distb);
00337
00338 clatms_(&n, &m, dista, &iseed[1], type__, &rwork[1], &
00339 modea, &cndnma, &anorm, &kla, &kua, "No packing",
00340 &a[1], &lda, &work[1], &iinfo);
00341 if (iinfo != 0) {
00342 io___36.ciunit = *nout;
00343 s_wsfe(&io___36);
00344 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00345 ;
00346 e_wsfe();
00347 *info = abs(iinfo);
00348 goto L30;
00349 }
00350
00351 clatms_(&n, &p, distb, &iseed[1], type__, &rwork[1], &
00352 modea, &cndnma, &bnorm, &klb, &kub, "No packing",
00353 &b[1], &ldb, &work[1], &iinfo);
00354 if (iinfo != 0) {
00355 io___37.ciunit = *nout;
00356 s_wsfe(&io___37);
00357 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00358 ;
00359 e_wsfe();
00360 *info = abs(iinfo);
00361 goto L30;
00362 }
00363
00364 nt = 4;
00365
00366 cgqrts_(&n, &m, &p, &a[1], &af[1], &aq[1], &ar[1], &lda, &
00367 taua[1], &b[1], &bf[1], &bz[1], &bt[1], &bwk[1], &
00368 ldb, &taub[1], &work[1], &lwork, &rwork[1],
00369 result);
00370
00371
00372
00373
00374 i__4 = nt;
00375 for (i__ = 1; i__ <= i__4; ++i__) {
00376 if (result[i__ - 1] >= *thresh) {
00377 if (nfail == 0 && firstt) {
00378 firstt = FALSE_;
00379 alahdg_(nout, path);
00380 }
00381 io___38.ciunit = *nout;
00382 s_wsfe(&io___38);
00383 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00384 ;
00385 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer))
00386 ;
00387 do_fio(&c__1, (char *)&p, (ftnlen)sizeof(integer))
00388 ;
00389 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00390 integer));
00391 do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(
00392 integer));
00393 do_fio(&c__1, (char *)&result[i__ - 1], (ftnlen)
00394 sizeof(real));
00395 e_wsfe();
00396 ++nfail;
00397 }
00398
00399 }
00400 nrun += nt;
00401
00402 L30:
00403 ;
00404 }
00405
00406 }
00407
00408 }
00409
00410 }
00411
00412
00413
00414 alasum_(path, nout, &nfail, &nrun, &c__0);
00415
00416 return 0;
00417
00418
00419
00420 }