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