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 complex c_b10 = {0.f,0.f};
00034 static real c_b15 = 1.f;
00035 static integer c__1 = 1;
00036
00037 int cchktz_(logical *dotype, integer *nm, integer *mval,
00038 integer *nn, integer *nval, real *thresh, logical *tsterr, complex *a,
00039 complex *copya, real *s, real *copys, complex *tau, complex *work,
00040 real *rwork, 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 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;
00066 extern doublereal cqrt12_(integer *, integer *, complex *, integer *,
00067 real *, complex *, integer *, real *);
00068 integer mnmin;
00069 extern doublereal crzt01_(integer *, integer *, complex *, complex *,
00070 integer *, complex *, complex *, integer *), crzt02_(integer *,
00071 integer *, complex *, integer *, complex *, complex *, integer *),
00072 ctzt01_(integer *, integer *, complex *, complex *, integer *,
00073 complex *, complex *, integer *), ctzt02_(integer *, integer *,
00074 complex *, integer *, complex *, complex *, integer *);
00075 integer nerrs, lwork;
00076 extern int cgeqr2_(integer *, integer *, complex *,
00077 integer *, complex *, complex *, integer *);
00078 extern doublereal slamch_(char *);
00079 extern int clacpy_(char *, integer *, integer *, complex
00080 *, integer *, complex *, integer *), claset_(char *,
00081 integer *, integer *, complex *, complex *, complex *, integer *), alasum_(char *, integer *, integer *, integer *, integer
00082 *), clatms_(integer *, integer *, char *, integer *, char
00083 *, real *, integer *, real *, real *, integer *, integer *, char *
00084 , complex *, integer *, complex *, integer *), slaord_(char *, integer *, real *, integer *),
00085 cerrtz_(char *, integer *), ctzrqf_(integer *, integer *,
00086 complex *, integer *, complex *, integer *);
00087 real result[6];
00088 extern int ctzrzf_(integer *, integer *, complex *,
00089 integer *, complex *, complex *, integer *, integer *);
00090
00091
00092 static cilist io___21 = { 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 --rwork;
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, "Complex precision", (ftnlen)1, (ftnlen)17);
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 = slamch_("Epsilon");
00207
00208
00209
00210 if (*tsterr) {
00211 cerrtz_(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;
00232 lwork = max(i__3,i__4);
00233
00234 if (m <= n) {
00235 for (imode = 1; imode <= 3; ++imode) {
00236
00237
00238
00239
00240
00241
00242 mode = imode - 1;
00243
00244
00245
00246
00247
00248
00249 if (mode == 0) {
00250 claset_("Full", &m, &n, &c_b10, &c_b10, &a[1], &lda);
00251 i__3 = mnmin;
00252 for (i__ = 1; i__ <= i__3; ++i__) {
00253 copys[i__] = 0.f;
00254
00255 }
00256 } else {
00257 r__1 = 1.f / eps;
00258 clatms_(&m, &n, "Uniform", iseed, "Nonsymmetric", &
00259 copys[1], &imode, &r__1, &c_b15, &m, &n,
00260 "No packing", &a[1], &lda, &work[1], &info);
00261 cgeqr2_(&m, &n, &a[1], &lda, &work[1], &work[mnmin +
00262 1], &info);
00263 i__3 = m - 1;
00264 claset_("Lower", &i__3, &n, &c_b10, &c_b10, &a[2], &
00265 lda);
00266 slaord_("Decreasing", &mnmin, ©s[1], &c__1);
00267 }
00268
00269
00270
00271 clacpy_("All", &m, &n, &a[1], &lda, ©a[1], &lda);
00272
00273
00274
00275
00276 s_copy(srnamc_1.srnamt, "CTZRQF", (ftnlen)32, (ftnlen)6);
00277 ctzrqf_(&m, &n, &a[1], &lda, &tau[1], &info);
00278
00279
00280
00281 result[0] = cqrt12_(&m, &m, &a[1], &lda, ©s[1], &work[
00282 1], &lwork, &rwork[1]);
00283
00284
00285
00286 result[1] = ctzt01_(&m, &n, ©a[1], &a[1], &lda, &tau[
00287 1], &work[1], &lwork);
00288
00289
00290
00291 result[2] = ctzt02_(&m, &n, &a[1], &lda, &tau[1], &work[1]
00292 , &lwork);
00293
00294
00295
00296
00297
00298
00299 if (mode == 0) {
00300 claset_("Full", &m, &n, &c_b10, &c_b10, &a[1], &lda);
00301 i__3 = mnmin;
00302 for (i__ = 1; i__ <= i__3; ++i__) {
00303 copys[i__] = 0.f;
00304
00305 }
00306 } else {
00307 r__1 = 1.f / eps;
00308 clatms_(&m, &n, "Uniform", iseed, "Nonsymmetric", &
00309 copys[1], &imode, &r__1, &c_b15, &m, &n,
00310 "No packing", &a[1], &lda, &work[1], &info);
00311 cgeqr2_(&m, &n, &a[1], &lda, &work[1], &work[mnmin +
00312 1], &info);
00313 i__3 = m - 1;
00314 claset_("Lower", &i__3, &n, &c_b10, &c_b10, &a[2], &
00315 lda);
00316 slaord_("Decreasing", &mnmin, ©s[1], &c__1);
00317 }
00318
00319
00320
00321 clacpy_("All", &m, &n, &a[1], &lda, ©a[1], &lda);
00322
00323
00324
00325
00326 s_copy(srnamc_1.srnamt, "CTZRZF", (ftnlen)32, (ftnlen)6);
00327 ctzrzf_(&m, &n, &a[1], &lda, &tau[1], &work[1], &lwork, &
00328 info);
00329
00330
00331
00332 result[3] = cqrt12_(&m, &m, &a[1], &lda, ©s[1], &work[
00333 1], &lwork, &rwork[1]);
00334
00335
00336
00337 result[4] = crzt01_(&m, &n, ©a[1], &a[1], &lda, &tau[
00338 1], &work[1], &lwork);
00339
00340
00341
00342 result[5] = crzt02_(&m, &n, &a[1], &lda, &tau[1], &work[1]
00343 , &lwork);
00344
00345
00346
00347
00348 for (k = 1; k <= 6; ++k) {
00349 if (result[k - 1] >= *thresh) {
00350 if (nfail == 0 && nerrs == 0) {
00351 alahd_(nout, path);
00352 }
00353 io___21.ciunit = *nout;
00354 s_wsfe(&io___21);
00355 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer))
00356 ;
00357 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00358 ;
00359 do_fio(&c__1, (char *)&imode, (ftnlen)sizeof(
00360 integer));
00361 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(integer))
00362 ;
00363 do_fio(&c__1, (char *)&result[k - 1], (ftnlen)
00364 sizeof(real));
00365 e_wsfe();
00366 ++nfail;
00367 }
00368
00369 }
00370 nrun += 6;
00371
00372 }
00373 }
00374
00375 }
00376
00377 }
00378
00379
00380
00381 alasum_(path, nout, &nfail, &nrun, &nerrs);
00382
00383
00384
00385
00386 return 0;
00387 }