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 ddrvrf4_(integer *nout, integer *nn, integer *nval,
00030 doublereal *thresh, doublereal *c1, doublereal *c2, integer *ldc,
00031 doublereal *crf, doublereal *a, integer *lda, doublereal *
00032 d_work_dlange__)
00033 {
00034
00035
00036 static integer iseedy[4] = { 1988,1989,1990,1991 };
00037 static char uplos[1*2] = "U" "L";
00038 static char forms[1*2] = "N" "T";
00039 static char transs[1*2] = "N" "T";
00040
00041
00042 static char fmt_9999[] = "(1x,\002 *** Error(s) or Failure(s) while test"
00043 "ing DSFRK ***\002)";
00044 static char fmt_9997[] = "(1x,\002 Failure in \002,a5,\002, CFORM="
00045 "'\002,a1,\002',\002,\002 UPLO='\002,a1,\002',\002,\002 TRANS="
00046 "'\002,a1,\002',\002,\002 N=\002,i3,\002, K =\002,i3,\002, test"
00047 "=\002,g12.5)";
00048 static char fmt_9996[] = "(1x,\002All tests for \002,a5,\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
00054
00055 integer a_dim1, a_offset, c1_dim1, c1_offset, c2_dim1, c2_offset, i__1,
00056 i__2, i__3, i__4;
00057 doublereal d__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, k, n, iik, iin;
00066 doublereal eps, beta;
00067 integer info;
00068 char uplo[1];
00069 integer nrun;
00070 doublereal alpha;
00071 integer nfail, iseed[4];
00072 char cform[1];
00073 extern int dsfrk_(char *, char *, char *, integer *,
00074 integer *, doublereal *, doublereal *, integer *, doublereal *,
00075 doublereal *);
00076 integer iform;
00077 doublereal norma, normc;
00078 char trans[1];
00079 integer iuplo;
00080 extern int dsyrk_(char *, char *, integer *, integer *,
00081 doublereal *, doublereal *, integer *, doublereal *, doublereal *,
00082 integer *);
00083 extern doublereal dlamch_(char *), dlange_(char *, integer *,
00084 integer *, doublereal *, integer *, doublereal *);
00085 integer ialpha;
00086 extern doublereal dlarnd_(integer *, integer *);
00087 integer itrans;
00088 extern int dtfttr_(char *, char *, integer *, doublereal
00089 *, doublereal *, integer *, integer *), dtrttf_(
00090 char *, char *, integer *, doublereal *, integer *, doublereal *,
00091 integer *);
00092 doublereal result[1];
00093
00094
00095 static cilist io___28 = { 0, 0, 0, 0, 0 };
00096 static cilist io___29 = { 0, 0, 0, fmt_9999, 0 };
00097 static cilist io___30 = { 0, 0, 0, fmt_9997, 0 };
00098 static cilist io___31 = { 0, 0, 0, fmt_9996, 0 };
00099 static cilist io___32 = { 0, 0, 0, fmt_9995, 0 };
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 --nval;
00177 c2_dim1 = *ldc;
00178 c2_offset = 1 + c2_dim1;
00179 c2 -= c2_offset;
00180 c1_dim1 = *ldc;
00181 c1_offset = 1 + c1_dim1;
00182 c1 -= c1_offset;
00183 --crf;
00184 a_dim1 = *lda;
00185 a_offset = 1 + a_dim1;
00186 a -= a_offset;
00187 --d_work_dlange__;
00188
00189
00190
00191
00192
00193
00194
00195 nrun = 0;
00196 nfail = 0;
00197 info = 0;
00198 for (i__ = 1; i__ <= 4; ++i__) {
00199 iseed[i__ - 1] = iseedy[i__ - 1];
00200
00201 }
00202 eps = dlamch_("Precision");
00203
00204 i__1 = *nn;
00205 for (iin = 1; iin <= i__1; ++iin) {
00206
00207 n = nval[iin];
00208
00209 i__2 = *nn;
00210 for (iik = 1; iik <= i__2; ++iik) {
00211
00212 k = nval[iin];
00213
00214 for (iform = 1; iform <= 2; ++iform) {
00215
00216 *(unsigned char *)cform = *(unsigned char *)&forms[iform - 1];
00217
00218 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00219
00220 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo -
00221 1];
00222
00223 for (itrans = 1; itrans <= 2; ++itrans) {
00224
00225 *(unsigned char *)trans = *(unsigned char *)&transs[
00226 itrans - 1];
00227
00228 for (ialpha = 1; ialpha <= 4; ++ialpha) {
00229
00230 if (ialpha == 1) {
00231 alpha = 0.;
00232 beta = 0.;
00233 } else if (ialpha == 2) {
00234 alpha = 1.;
00235 beta = 0.;
00236 } else if (ialpha == 3) {
00237 alpha = 0.;
00238 beta = 1.;
00239 } else {
00240 alpha = dlarnd_(&c__2, iseed);
00241 beta = dlarnd_(&c__2, iseed);
00242 }
00243
00244
00245
00246
00247
00248
00249 ++nrun;
00250
00251 if (itrans == 1) {
00252
00253
00254
00255 i__3 = k;
00256 for (j = 1; j <= i__3; ++j) {
00257 i__4 = n;
00258 for (i__ = 1; i__ <= i__4; ++i__) {
00259 a[i__ + j * a_dim1] = dlarnd_(&c__2,
00260 iseed);
00261 }
00262 }
00263
00264 norma = dlange_("I", &n, &k, &a[a_offset],
00265 lda, &d_work_dlange__[1]);
00266
00267 } else {
00268
00269
00270
00271 i__3 = n;
00272 for (j = 1; j <= i__3; ++j) {
00273 i__4 = k;
00274 for (i__ = 1; i__ <= i__4; ++i__) {
00275 a[i__ + j * a_dim1] = dlarnd_(&c__2,
00276 iseed);
00277 }
00278 }
00279
00280 norma = dlange_("I", &k, &n, &a[a_offset],
00281 lda, &d_work_dlange__[1]);
00282
00283 }
00284
00285
00286
00287
00288
00289
00290 i__3 = n;
00291 for (j = 1; j <= i__3; ++j) {
00292 i__4 = n;
00293 for (i__ = 1; i__ <= i__4; ++i__) {
00294 c1[i__ + j * c1_dim1] = dlarnd_(&c__2,
00295 iseed);
00296 c2[i__ + j * c2_dim1] = c1[i__ + j *
00297 c1_dim1];
00298 }
00299 }
00300
00301
00302
00303
00304 normc = dlange_("I", &n, &n, &c1[c1_offset], ldc,
00305 &d_work_dlange__[1]);
00306
00307 s_copy(srnamc_1.srnamt, "DTRTTF", (ftnlen)32, (
00308 ftnlen)6);
00309 dtrttf_(cform, uplo, &n, &c1[c1_offset], ldc, &
00310 crf[1], &info);
00311
00312
00313
00314 s_copy(srnamc_1.srnamt, "DSYRK ", (ftnlen)32, (
00315 ftnlen)6);
00316 dsyrk_(uplo, trans, &n, &k, &alpha, &a[a_offset],
00317 lda, &beta, &c1[c1_offset], ldc);
00318
00319
00320
00321 s_copy(srnamc_1.srnamt, "DSFRK ", (ftnlen)32, (
00322 ftnlen)6);
00323 dsfrk_(cform, uplo, trans, &n, &k, &alpha, &a[
00324 a_offset], lda, &beta, &crf[1]);
00325
00326
00327
00328 s_copy(srnamc_1.srnamt, "DTFTTR", (ftnlen)32, (
00329 ftnlen)6);
00330 dtfttr_(cform, uplo, &n, &crf[1], &c2[c2_offset],
00331 ldc, &info);
00332
00333
00334
00335 i__3 = n;
00336 for (j = 1; j <= i__3; ++j) {
00337 i__4 = n;
00338 for (i__ = 1; i__ <= i__4; ++i__) {
00339 c1[i__ + j * c1_dim1] -= c2[i__ + j *
00340 c2_dim1];
00341 }
00342 }
00343
00344
00345
00346
00347
00348
00349 result[0] = dlange_("I", &n, &n, &c1[c1_offset],
00350 ldc, &d_work_dlange__[1]);
00351
00352 d__1 = abs(alpha) * norma + abs(beta);
00353 result[0] = result[0] / max(d__1,1.) / max(n,1) /
00354 eps;
00355
00356 if (result[0] >= *thresh) {
00357 if (nfail == 0) {
00358 io___28.ciunit = *nout;
00359 s_wsle(&io___28);
00360 e_wsle();
00361 io___29.ciunit = *nout;
00362 s_wsfe(&io___29);
00363 e_wsfe();
00364 }
00365 io___30.ciunit = *nout;
00366 s_wsfe(&io___30);
00367 do_fio(&c__1, "DSFRK", (ftnlen)5);
00368 do_fio(&c__1, cform, (ftnlen)1);
00369 do_fio(&c__1, uplo, (ftnlen)1);
00370 do_fio(&c__1, trans, (ftnlen)1);
00371 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(
00372 integer));
00373 do_fio(&c__1, (char *)&k, (ftnlen)sizeof(
00374 integer));
00375 do_fio(&c__1, (char *)&result[0], (ftnlen)
00376 sizeof(doublereal));
00377 e_wsfe();
00378 ++nfail;
00379 }
00380
00381
00382 }
00383
00384 }
00385
00386 }
00387
00388 }
00389
00390 }
00391
00392 }
00393
00394
00395
00396 if (nfail == 0) {
00397 io___31.ciunit = *nout;
00398 s_wsfe(&io___31);
00399 do_fio(&c__1, "DSFRK", (ftnlen)5);
00400 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00401 e_wsfe();
00402 } else {
00403 io___32.ciunit = *nout;
00404 s_wsfe(&io___32);
00405 do_fio(&c__1, "DSFRK", (ftnlen)5);
00406 do_fio(&c__1, (char *)&nfail, (ftnlen)sizeof(integer));
00407 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00408 e_wsfe();
00409 }
00410
00411
00412 return 0;
00413
00414
00415
00416 }