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