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, iounit;
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 real c_b11 = 0.f;
00034 static real c_b16 = 1.f;
00035 static integer c__1 = 1;
00036 static integer c__3 = 3;
00037
00038 int schkq3_(logical *dotype, integer *nm, integer *mval,
00039 integer *nn, integer *nval, integer *nnb, integer *nbval, integer *
00040 nxval, real *thresh, real *a, real *copya, real *s, real *copys, real
00041 *tau, real *work, integer *iwork, integer *nout)
00042 {
00043
00044
00045 static integer iseedy[4] = { 1988,1989,1990,1991 };
00046
00047
00048 static char fmt_9999[] = "(1x,a,\002 M =\002,i5,\002, N =\002,i5,\002, N"
00049 "B =\002,i4,\002, type \002,i2,\002, test \002,i2,\002, ratio "
00050 "=\002,g12.5)";
00051
00052
00053 integer i__1, i__2, i__3, i__4, i__5;
00054 real r__1;
00055
00056
00057 int s_copy(char *, char *, ftnlen, ftnlen);
00058 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00059
00060
00061 integer i__, k, m, n, nb, im, in, lw, nx, lda, inb;
00062 real eps;
00063 integer mode, info;
00064 char path[3];
00065 integer ilow, nrun;
00066 extern int alahd_(integer *, char *);
00067 integer ihigh, nfail, iseed[4], imode, mnmin;
00068 extern int icopy_(integer *, integer *, integer *,
00069 integer *, integer *);
00070 integer istep, nerrs;
00071 extern doublereal sqpt01_(integer *, integer *, integer *, real *, real *,
00072 integer *, real *, integer *, real *, integer *), sqrt11_(
00073 integer *, integer *, real *, integer *, real *, real *, integer *
00074 );
00075 integer lwork;
00076 extern doublereal sqrt12_(integer *, integer *, real *, integer *, real *,
00077 real *, integer *);
00078 extern int sgeqp3_(integer *, integer *, real *, integer
00079 *, integer *, real *, real *, integer *, integer *);
00080 extern doublereal slamch_(char *);
00081 extern int alasum_(char *, integer *, integer *, integer
00082 *, integer *), slaord_(char *, integer *, real *, integer
00083 *), slacpy_(char *, integer *, integer *, real *, integer
00084 *, real *, integer *), slaset_(char *, integer *, integer
00085 *, real *, real *, real *, integer *), xlaenv_(integer *,
00086 integer *), slatms_(integer *, integer *, char *, integer *, char
00087 *, real *, integer *, real *, real *, integer *, integer *, char *
00088 , real *, integer *, real *, integer *);
00089 real result[3];
00090
00091
00092 static cilist io___28 = { 0, 0, 0, fmt_9999, 0 };
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 --iwork;
00189 --work;
00190 --tau;
00191 --copys;
00192 --s;
00193 --copya;
00194 --a;
00195 --nxval;
00196 --nbval;
00197 --nval;
00198 --mval;
00199 --dotype;
00200
00201
00202
00203
00204
00205
00206
00207 s_copy(path, "Single precision", (ftnlen)1, (ftnlen)16);
00208 s_copy(path + 1, "Q3", (ftnlen)2, (ftnlen)2);
00209 nrun = 0;
00210 nfail = 0;
00211 nerrs = 0;
00212 for (i__ = 1; i__ <= 4; ++i__) {
00213 iseed[i__ - 1] = iseedy[i__ - 1];
00214
00215 }
00216 eps = slamch_("Epsilon");
00217 infoc_1.infot = 0;
00218
00219 i__1 = *nm;
00220 for (im = 1; im <= i__1; ++im) {
00221
00222
00223
00224 m = mval[im];
00225 lda = max(1,m);
00226
00227 i__2 = *nn;
00228 for (in = 1; in <= i__2; ++in) {
00229
00230
00231
00232 n = nval[in];
00233 mnmin = min(m,n);
00234
00235 i__3 = 1, i__4 = m * max(m,n) + (mnmin << 2) + max(m,n), i__3 =
00236 max(i__3,i__4), i__4 = m * n + (mnmin << 1) + (n << 2);
00237 lwork = max(i__3,i__4);
00238
00239 for (imode = 1; imode <= 6; ++imode) {
00240 if (! dotype[imode]) {
00241 goto L70;
00242 }
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252 mode = imode;
00253 if (imode > 3) {
00254 mode = 1;
00255 }
00256
00257
00258
00259
00260 i__3 = n;
00261 for (i__ = 1; i__ <= i__3; ++i__) {
00262 iwork[i__] = 0;
00263
00264 }
00265 if (imode == 1) {
00266 slaset_("Full", &m, &n, &c_b11, &c_b11, ©a[1], &lda);
00267 i__3 = mnmin;
00268 for (i__ = 1; i__ <= i__3; ++i__) {
00269 copys[i__] = 0.f;
00270
00271 }
00272 } else {
00273 r__1 = 1.f / eps;
00274 slatms_(&m, &n, "Uniform", iseed, "Nonsymm", ©s[1], &
00275 mode, &r__1, &c_b16, &m, &n, "No packing", ©a[
00276 1], &lda, &work[1], &info);
00277 if (imode >= 4) {
00278 if (imode == 4) {
00279 ilow = 1;
00280 istep = 1;
00281
00282 i__3 = 1, i__4 = n / 2;
00283 ihigh = max(i__3,i__4);
00284 } else if (imode == 5) {
00285
00286 i__3 = 1, i__4 = n / 2;
00287 ilow = max(i__3,i__4);
00288 istep = 1;
00289 ihigh = n;
00290 } else if (imode == 6) {
00291 ilow = 1;
00292 istep = 2;
00293 ihigh = n;
00294 }
00295 i__3 = ihigh;
00296 i__4 = istep;
00297 for (i__ = ilow; i__4 < 0 ? i__ >= i__3 : i__ <= i__3;
00298 i__ += i__4) {
00299 iwork[i__] = 1;
00300
00301 }
00302 }
00303 slaord_("Decreasing", &mnmin, ©s[1], &c__1);
00304 }
00305
00306 i__4 = *nnb;
00307 for (inb = 1; inb <= i__4; ++inb) {
00308
00309
00310
00311 nb = nbval[inb];
00312 xlaenv_(&c__1, &nb);
00313 nx = nxval[inb];
00314 xlaenv_(&c__3, &nx);
00315
00316
00317
00318
00319 slacpy_("All", &m, &n, ©a[1], &lda, &a[1], &lda);
00320 icopy_(&n, &iwork[1], &c__1, &iwork[n + 1], &c__1);
00321
00322
00323
00324
00325 i__3 = 1, i__5 = (n << 1) + nb * (n + 1);
00326 lw = max(i__3,i__5);
00327
00328
00329
00330 s_copy(srnamc_1.srnamt, "SGEQP3", (ftnlen)32, (ftnlen)6);
00331 sgeqp3_(&m, &n, &a[1], &lda, &iwork[n + 1], &tau[1], &
00332 work[1], &lw, &info);
00333
00334
00335
00336 result[0] = sqrt12_(&m, &n, &a[1], &lda, ©s[1], &work[
00337 1], &lwork);
00338
00339
00340
00341 result[1] = sqpt01_(&m, &n, &mnmin, ©a[1], &a[1], &
00342 lda, &tau[1], &iwork[n + 1], &work[1], &lwork);
00343
00344
00345
00346 result[2] = sqrt11_(&m, &mnmin, &a[1], &lda, &tau[1], &
00347 work[1], &lwork);
00348
00349
00350
00351
00352 for (k = 1; k <= 3; ++k) {
00353 if (result[k - 1] >= *thresh) {
00354 if (nfail == 0 && nerrs == 0) {
00355 alahd_(nout, path);
00356 }
00357 io___28.ciunit = *nout;
00358 s_wsfe(&io___28);
00359 do_fio(&c__1, "SGEQP3", (ftnlen)6);
00360 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer))
00361 ;
00362 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00363 ;
00364 do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(integer)
00365 );
00366 do_fio(&c__1, (char *)&imode, (ftnlen)sizeof(
00367 integer));
00368 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer))
00369 ;
00370 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00371 sizeof(real));
00372 e_wsfe();
00373 ++nfail;
00374 }
00375
00376 }
00377 nrun += 3;
00378
00379
00380 }
00381 L70:
00382 ;
00383 }
00384
00385 }
00386
00387 }
00388
00389
00390
00391 alasum_(path, nout, &nfail, &nrun, &nerrs);
00392
00393
00394
00395
00396 return 0;
00397 }