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