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 char srnamt[32];
00020 } srnamc_;
00021
00022 #define srnamc_1 srnamc_
00023
00024
00025
00026 static integer c__4 = 4;
00027 static integer c__1 = 1;
00028
00029 int cdrvrf1_(integer *nout, integer *nn, integer *nval, real
00030 *thresh, complex *a, integer *lda, complex *arf, real *work)
00031 {
00032
00033
00034 static integer iseedy[4] = { 1988,1989,1990,1991 };
00035 static char uplos[1*2] = "U" "L";
00036 static char forms[1*2] = "N" "C";
00037 static char norms[1*4] = "M" "1" "I" "F";
00038
00039
00040 static char fmt_9999[] = "(1x,\002 *** Error(s) or Failure(s) while test"
00041 "ing CLANHF ***\002)";
00042 static char fmt_9998[] = "(1x,\002 Error in \002,a6,\002 with UPLO="
00043 "'\002,a1,\002', FORM='\002,a1,\002', N=\002,i5)";
00044 static char fmt_9997[] = "(1x,\002 Failure in \002,a6,\002 N=\002,"
00045 "i5,\002 TYPE=\002,i5,\002 UPLO='\002,a1,\002', FORM ='\002,a1"
00046 ",\002', NORM='\002,a1,\002', test=\002,g12.5)";
00047 static char fmt_9996[] = "(1x,\002All tests for \002,a6,\002 auxiliary r"
00048 "outine passed the \002,\002threshold (\002,i5,\002 tests run)"
00049 "\002)";
00050 static char fmt_9995[] = "(1x,a6,\002 auxiliary routine:\002,i5,\002 out"
00051 " of \002,i5,\002 tests failed to pass the threshold\002)";
00052 static char fmt_9994[] = "(26x,i5,\002 error message recorded (\002,a6"
00053 ",\002)\002)";
00054
00055
00056 integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5;
00057 complex q__1;
00058
00059
00060 int s_copy(char *, char *, ftnlen, ftnlen);
00061 integer s_wsle(cilist *), e_wsle(void), s_wsfe(cilist *), e_wsfe(void),
00062 do_fio(integer *, char *, ftnlen);
00063
00064
00065 integer i__, j, n, iin, iit;
00066 real eps;
00067 integer info;
00068 char norm[1], uplo[1];
00069 integer nrun, nfail;
00070 real large;
00071 integer iseed[4];
00072 char cform[1];
00073 real small;
00074 integer iform;
00075 real norma;
00076 integer inorm, iuplo, nerrs;
00077 extern doublereal clanhe_(char *, char *, integer *, complex *, integer *,
00078 real *), clanhf_(char *, char *, char *, integer
00079 *, complex *, real *);
00080 extern VOID clarnd_(complex *, integer *, integer *);
00081 extern doublereal slamch_(char *);
00082 extern int ctrttf_(char *, char *, integer *, complex *,
00083 integer *, complex *, integer *);
00084 real result[1], normarf;
00085
00086
00087 static cilist io___22 = { 0, 0, 0, 0, 0 };
00088 static cilist io___23 = { 0, 0, 0, fmt_9999, 0 };
00089 static cilist io___24 = { 0, 0, 0, fmt_9998, 0 };
00090 static cilist io___30 = { 0, 0, 0, 0, 0 };
00091 static cilist io___31 = { 0, 0, 0, fmt_9999, 0 };
00092 static cilist io___32 = { 0, 0, 0, fmt_9997, 0 };
00093 static cilist io___33 = { 0, 0, 0, fmt_9996, 0 };
00094 static cilist io___34 = { 0, 0, 0, fmt_9995, 0 };
00095 static cilist io___35 = { 0, 0, 0, fmt_9994, 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 --nval;
00159 a_dim1 = *lda;
00160 a_offset = 1 + a_dim1;
00161 a -= a_offset;
00162 --arf;
00163 --work;
00164
00165
00166
00167
00168
00169
00170
00171 nrun = 0;
00172 nfail = 0;
00173 nerrs = 0;
00174 info = 0;
00175 for (i__ = 1; i__ <= 4; ++i__) {
00176 iseed[i__ - 1] = iseedy[i__ - 1];
00177
00178 }
00179
00180 eps = slamch_("Precision");
00181 small = slamch_("Safe minimum");
00182 large = 1.f / small;
00183 small = small * *lda * *lda;
00184 large = large / *lda / *lda;
00185
00186 i__1 = *nn;
00187 for (iin = 1; iin <= i__1; ++iin) {
00188
00189 n = nval[iin];
00190
00191 for (iit = 1; iit <= 3; ++iit) {
00192
00193
00194
00195
00196
00197 i__2 = n;
00198 for (j = 1; j <= i__2; ++j) {
00199 i__3 = n;
00200 for (i__ = 1; i__ <= i__3; ++i__) {
00201 i__4 = i__ + j * a_dim1;
00202 clarnd_(&q__1, &c__4, iseed);
00203 a[i__4].r = q__1.r, a[i__4].i = q__1.i;
00204 }
00205 }
00206
00207 if (iit == 2) {
00208 i__2 = n;
00209 for (j = 1; j <= i__2; ++j) {
00210 i__3 = n;
00211 for (i__ = 1; i__ <= i__3; ++i__) {
00212 i__4 = i__ + j * a_dim1;
00213 i__5 = i__ + j * a_dim1;
00214 q__1.r = large * a[i__5].r, q__1.i = large * a[i__5]
00215 .i;
00216 a[i__4].r = q__1.r, a[i__4].i = q__1.i;
00217 }
00218 }
00219 }
00220
00221 if (iit == 3) {
00222 i__2 = n;
00223 for (j = 1; j <= i__2; ++j) {
00224 i__3 = n;
00225 for (i__ = 1; i__ <= i__3; ++i__) {
00226 i__4 = i__ + j * a_dim1;
00227 i__5 = i__ + j * a_dim1;
00228 q__1.r = small * a[i__5].r, q__1.i = small * a[i__5]
00229 .i;
00230 a[i__4].r = q__1.r, a[i__4].i = q__1.i;
00231 }
00232 }
00233 }
00234
00235
00236
00237 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00238
00239 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00240
00241
00242
00243 for (iform = 1; iform <= 2; ++iform) {
00244
00245 *(unsigned char *)cform = *(unsigned char *)&forms[iform
00246 - 1];
00247
00248 s_copy(srnamc_1.srnamt, "CTRTTF", (ftnlen)32, (ftnlen)6);
00249 ctrttf_(cform, uplo, &n, &a[a_offset], lda, &arf[1], &
00250 info);
00251
00252
00253
00254 if (info != 0) {
00255 if (nfail == 0 && nerrs == 0) {
00256 io___22.ciunit = *nout;
00257 s_wsle(&io___22);
00258 e_wsle();
00259 io___23.ciunit = *nout;
00260 s_wsfe(&io___23);
00261 e_wsfe();
00262 }
00263 io___24.ciunit = *nout;
00264 s_wsfe(&io___24);
00265 do_fio(&c__1, srnamc_1.srnamt, (ftnlen)32);
00266 do_fio(&c__1, uplo, (ftnlen)1);
00267 do_fio(&c__1, cform, (ftnlen)1);
00268 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00269 e_wsfe();
00270 ++nerrs;
00271 goto L100;
00272 }
00273
00274 for (inorm = 1; inorm <= 4; ++inorm) {
00275
00276
00277
00278 *(unsigned char *)norm = *(unsigned char *)&norms[
00279 inorm - 1];
00280 normarf = clanhf_(norm, cform, uplo, &n, &arf[1], &
00281 work[1]);
00282 norma = clanhe_(norm, uplo, &n, &a[a_offset], lda, &
00283 work[1]);
00284
00285 result[0] = (norma - normarf) / norma / eps;
00286 ++nrun;
00287
00288 if (result[0] >= *thresh) {
00289 if (nfail == 0 && nerrs == 0) {
00290 io___30.ciunit = *nout;
00291 s_wsle(&io___30);
00292 e_wsle();
00293 io___31.ciunit = *nout;
00294 s_wsfe(&io___31);
00295 e_wsfe();
00296 }
00297 io___32.ciunit = *nout;
00298 s_wsfe(&io___32);
00299 do_fio(&c__1, "CLANHF", (ftnlen)6);
00300 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00301 ;
00302 do_fio(&c__1, (char *)&iit, (ftnlen)sizeof(
00303 integer));
00304 do_fio(&c__1, uplo, (ftnlen)1);
00305 do_fio(&c__1, cform, (ftnlen)1);
00306 do_fio(&c__1, norm, (ftnlen)1);
00307 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(
00308 real));
00309 e_wsfe();
00310 ++nfail;
00311 }
00312
00313 }
00314 L100:
00315 ;
00316 }
00317
00318 }
00319
00320 }
00321
00322 }
00323
00324
00325
00326 if (nfail == 0) {
00327 io___33.ciunit = *nout;
00328 s_wsfe(&io___33);
00329 do_fio(&c__1, "CLANHF", (ftnlen)6);
00330 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00331 e_wsfe();
00332 } else {
00333 io___34.ciunit = *nout;
00334 s_wsfe(&io___34);
00335 do_fio(&c__1, "CLANHF", (ftnlen)6);
00336 do_fio(&c__1, (char *)&nfail, (ftnlen)sizeof(integer));
00337 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00338 e_wsfe();
00339 }
00340 if (nerrs != 0) {
00341 io___35.ciunit = *nout;
00342 s_wsfe(&io___35);
00343 do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00344 do_fio(&c__1, "CLANHF", (ftnlen)6);
00345 e_wsfe();
00346 }
00347
00348
00349 return 0;
00350
00351
00352
00353 }