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