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__2 = 2;
00027 static integer c__1 = 1;
00028
00029 int ddrvrf1_(integer *nout, integer *nn, integer *nval,
00030 doublereal *thresh, doublereal *a, integer *lda, doublereal *arf,
00031 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" "T";
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 DLANSF ***\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;
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 doublereal eps;
00067 integer info;
00068 char norm[1], uplo[1];
00069 integer nrun, nfail;
00070 doublereal large;
00071 integer iseed[4];
00072 char cform[1];
00073 doublereal small;
00074 integer iform;
00075 doublereal norma;
00076 integer inorm, iuplo, nerrs;
00077 extern doublereal dlamch_(char *), dlarnd_(integer *, integer *),
00078 dlansf_(char *, char *, char *, integer *, doublereal *,
00079 doublereal *), dlansy_(char *, char *,
00080 integer *, doublereal *, integer *, doublereal *);
00081 extern int dtrttf_(char *, char *, integer *, doublereal
00082 *, integer *, doublereal *, integer *);
00083 doublereal result[1], normarf;
00084
00085
00086 static cilist io___22 = { 0, 0, 0, 0, 0 };
00087 static cilist io___23 = { 0, 0, 0, fmt_9999, 0 };
00088 static cilist io___24 = { 0, 0, 0, fmt_9998, 0 };
00089 static cilist io___30 = { 0, 0, 0, 0, 0 };
00090 static cilist io___31 = { 0, 0, 0, fmt_9999, 0 };
00091 static cilist io___32 = { 0, 0, 0, fmt_9997, 0 };
00092 static cilist io___33 = { 0, 0, 0, fmt_9996, 0 };
00093 static cilist io___34 = { 0, 0, 0, fmt_9995, 0 };
00094 static cilist io___35 = { 0, 0, 0, fmt_9994, 0 };
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 --nval;
00158 a_dim1 = *lda;
00159 a_offset = 1 + a_dim1;
00160 a -= a_offset;
00161 --arf;
00162 --work;
00163
00164
00165
00166
00167
00168
00169
00170 nrun = 0;
00171 nfail = 0;
00172 nerrs = 0;
00173 info = 0;
00174 for (i__ = 1; i__ <= 4; ++i__) {
00175 iseed[i__ - 1] = iseedy[i__ - 1];
00176
00177 }
00178
00179 eps = dlamch_("Precision");
00180 small = dlamch_("Safe minimum");
00181 large = 1. / small;
00182 small = small * *lda * *lda;
00183 large = large / *lda / *lda;
00184
00185 i__1 = *nn;
00186 for (iin = 1; iin <= i__1; ++iin) {
00187
00188 n = nval[iin];
00189
00190 for (iit = 1; iit <= 3; ++iit) {
00191
00192
00193
00194
00195
00196 i__2 = n;
00197 for (j = 1; j <= i__2; ++j) {
00198 i__3 = n;
00199 for (i__ = 1; i__ <= i__3; ++i__) {
00200 a[i__ + j * a_dim1] = dlarnd_(&c__2, iseed);
00201 }
00202 }
00203
00204 if (iit == 2) {
00205 i__2 = n;
00206 for (j = 1; j <= i__2; ++j) {
00207 i__3 = n;
00208 for (i__ = 1; i__ <= i__3; ++i__) {
00209 a[i__ + j * a_dim1] *= large;
00210 }
00211 }
00212 }
00213
00214 if (iit == 3) {
00215 i__2 = n;
00216 for (j = 1; j <= i__2; ++j) {
00217 i__3 = n;
00218 for (i__ = 1; i__ <= i__3; ++i__) {
00219 a[i__ + j * a_dim1] *= small;
00220 }
00221 }
00222 }
00223
00224
00225
00226 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00227
00228 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00229
00230
00231
00232 for (iform = 1; iform <= 2; ++iform) {
00233
00234 *(unsigned char *)cform = *(unsigned char *)&forms[iform
00235 - 1];
00236
00237 s_copy(srnamc_1.srnamt, "DTRTTF", (ftnlen)32, (ftnlen)6);
00238 dtrttf_(cform, uplo, &n, &a[a_offset], lda, &arf[1], &
00239 info);
00240
00241
00242
00243 if (info != 0) {
00244 if (nfail == 0 && nerrs == 0) {
00245 io___22.ciunit = *nout;
00246 s_wsle(&io___22);
00247 e_wsle();
00248 io___23.ciunit = *nout;
00249 s_wsfe(&io___23);
00250 e_wsfe();
00251 }
00252 io___24.ciunit = *nout;
00253 s_wsfe(&io___24);
00254 do_fio(&c__1, srnamc_1.srnamt, (ftnlen)32);
00255 do_fio(&c__1, uplo, (ftnlen)1);
00256 do_fio(&c__1, cform, (ftnlen)1);
00257 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00258 e_wsfe();
00259 ++nerrs;
00260 goto L100;
00261 }
00262
00263 for (inorm = 1; inorm <= 4; ++inorm) {
00264
00265
00266
00267 *(unsigned char *)norm = *(unsigned char *)&norms[
00268 inorm - 1];
00269 normarf = dlansf_(norm, cform, uplo, &n, &arf[1], &
00270 work[1]);
00271 norma = dlansy_(norm, uplo, &n, &a[a_offset], lda, &
00272 work[1]);
00273
00274 result[0] = (norma - normarf) / norma / eps;
00275 ++nrun;
00276
00277 if (result[0] >= *thresh) {
00278 if (nfail == 0 && nerrs == 0) {
00279 io___30.ciunit = *nout;
00280 s_wsle(&io___30);
00281 e_wsle();
00282 io___31.ciunit = *nout;
00283 s_wsfe(&io___31);
00284 e_wsfe();
00285 }
00286 io___32.ciunit = *nout;
00287 s_wsfe(&io___32);
00288 do_fio(&c__1, "DLANSF", (ftnlen)6);
00289 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00290 ;
00291 do_fio(&c__1, (char *)&iit, (ftnlen)sizeof(
00292 integer));
00293 do_fio(&c__1, uplo, (ftnlen)1);
00294 do_fio(&c__1, cform, (ftnlen)1);
00295 do_fio(&c__1, norm, (ftnlen)1);
00296 do_fio(&c__1, (char *)&result[0], (ftnlen)sizeof(
00297 doublereal));
00298 e_wsfe();
00299 ++nfail;
00300 }
00301
00302 }
00303 L100:
00304 ;
00305 }
00306
00307 }
00308
00309 }
00310
00311 }
00312
00313
00314
00315 if (nfail == 0) {
00316 io___33.ciunit = *nout;
00317 s_wsfe(&io___33);
00318 do_fio(&c__1, "DLANSF", (ftnlen)6);
00319 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00320 e_wsfe();
00321 } else {
00322 io___34.ciunit = *nout;
00323 s_wsfe(&io___34);
00324 do_fio(&c__1, "DLANSF", (ftnlen)6);
00325 do_fio(&c__1, (char *)&nfail, (ftnlen)sizeof(integer));
00326 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00327 e_wsfe();
00328 }
00329 if (nerrs != 0) {
00330 io___35.ciunit = *nout;
00331 s_wsfe(&io___35);
00332 do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00333 do_fio(&c__1, "DLANSF", (ftnlen)6);
00334 e_wsfe();
00335 }
00336
00337
00338 return 0;
00339
00340
00341
00342 }