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 ddrvrf3_(integer *nout, integer *nn, integer *nval,
00030 doublereal *thresh, doublereal *a, integer *lda, doublereal *arf,
00031 doublereal *b1, doublereal *b2, doublereal *d_work_dlange__,
00032 doublereal *d_work_dgeqrf__, doublereal *tau)
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 sides[1*2] = "L" "R";
00040 static char transs[1*2] = "N" "T";
00041 static char diags[1*2] = "N" "U";
00042
00043
00044 static char fmt_9999[] = "(1x,\002 *** Error(s) or Failure(s) while test"
00045 "ing DTFSM ***\002)";
00046 static char fmt_9997[] = "(1x,\002 Failure in \002,a5,\002, CFORM="
00047 "'\002,a1,\002',\002,\002 SIDE='\002,a1,\002',\002,\002 UPLO='"
00048 "\002,a1,\002',\002,\002 TRANS='\002,a1,\002',\002,\002 DIAG='"
00049 "\002,a1,\002',\002,\002 M=\002,i3,\002, N =\002,i3,\002, test"
00050 "=\002,g12.5)";
00051 static char fmt_9996[] = "(1x,\002All tests for \002,a5,\002 auxiliary r"
00052 "outine passed the \002,\002threshold (\002,i5,\002 tests run)"
00053 "\002)";
00054 static char fmt_9995[] = "(1x,a6,\002 auxiliary routine:\002,i5,\002 out"
00055 " of \002,i5,\002 tests failed to pass the threshold\002)";
00056
00057
00058 integer a_dim1, a_offset, b1_dim1, b1_offset, b2_dim1, b2_offset, i__1,
00059 i__2, i__3, i__4;
00060
00061
00062 int s_copy(char *, char *, ftnlen, ftnlen);
00063 double sqrt(doublereal);
00064 integer s_wsle(cilist *), e_wsle(void), s_wsfe(cilist *), e_wsfe(void),
00065 do_fio(integer *, char *, ftnlen);
00066
00067
00068 integer i__, j, m, n, na, iim, iin;
00069 doublereal eps;
00070 char diag[1], side[1];
00071 integer info;
00072 char uplo[1];
00073 integer nrun, idiag;
00074 doublereal alpha;
00075 integer nfail, iseed[4], iside;
00076 char cform[1];
00077 integer iform;
00078 extern int dtfsm_(char *, char *, char *, char *, char *,
00079 integer *, integer *, doublereal *, doublereal *, doublereal *,
00080 integer *);
00081 char trans[1];
00082 integer iuplo;
00083 extern int dtrsm_(char *, char *, char *, char *,
00084 integer *, integer *, doublereal *, doublereal *, integer *,
00085 doublereal *, integer *);
00086 extern doublereal dlamch_(char *), dlange_(char *, integer *,
00087 integer *, doublereal *, integer *, doublereal *);
00088 integer ialpha;
00089 extern int dgelqf_(integer *, integer *, doublereal *,
00090 integer *, doublereal *, doublereal *, integer *, integer *);
00091 extern doublereal dlarnd_(integer *, integer *);
00092 extern int dgeqrf_(integer *, integer *, doublereal *,
00093 integer *, doublereal *, doublereal *, integer *, integer *);
00094 integer itrans;
00095 extern int dtrttf_(char *, char *, integer *, doublereal
00096 *, integer *, doublereal *, integer *);
00097 doublereal result[1];
00098
00099
00100 static cilist io___32 = { 0, 0, 0, 0, 0 };
00101 static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
00102 static cilist io___34 = { 0, 0, 0, fmt_9997, 0 };
00103 static cilist io___35 = { 0, 0, 0, fmt_9996, 0 };
00104 static cilist io___36 = { 0, 0, 0, fmt_9995, 0 };
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 --nval;
00178 b2_dim1 = *lda;
00179 b2_offset = 1 + b2_dim1;
00180 b2 -= b2_offset;
00181 b1_dim1 = *lda;
00182 b1_offset = 1 + b1_dim1;
00183 b1 -= b1_offset;
00184 a_dim1 = *lda;
00185 a_offset = 1 + a_dim1;
00186 a -= a_offset;
00187 --arf;
00188 --d_work_dlange__;
00189 --d_work_dgeqrf__;
00190 --tau;
00191
00192
00193
00194
00195
00196
00197
00198 nrun = 0;
00199 nfail = 0;
00200 info = 0;
00201 for (i__ = 1; i__ <= 4; ++i__) {
00202 iseed[i__ - 1] = iseedy[i__ - 1];
00203
00204 }
00205 eps = dlamch_("Precision");
00206
00207 i__1 = *nn;
00208 for (iim = 1; iim <= i__1; ++iim) {
00209
00210 m = nval[iim];
00211
00212 i__2 = *nn;
00213 for (iin = 1; iin <= i__2; ++iin) {
00214
00215 n = nval[iin];
00216
00217 for (iform = 1; iform <= 2; ++iform) {
00218
00219 *(unsigned char *)cform = *(unsigned char *)&forms[iform - 1];
00220
00221 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00222
00223 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo -
00224 1];
00225
00226 for (iside = 1; iside <= 2; ++iside) {
00227
00228 *(unsigned char *)side = *(unsigned char *)&sides[
00229 iside - 1];
00230
00231 for (itrans = 1; itrans <= 2; ++itrans) {
00232
00233 *(unsigned char *)trans = *(unsigned char *)&
00234 transs[itrans - 1];
00235
00236 for (idiag = 1; idiag <= 2; ++idiag) {
00237
00238 *(unsigned char *)diag = *(unsigned char *)&
00239 diags[idiag - 1];
00240
00241 for (ialpha = 1; ialpha <= 3; ++ialpha) {
00242
00243 if (ialpha == 1) {
00244 alpha = 0.;
00245 } else if (ialpha == 1) {
00246 alpha = 1.;
00247 } else {
00248 alpha = dlarnd_(&c__2, iseed);
00249 }
00250
00251
00252
00253
00254
00255
00256 ++nrun;
00257
00258 if (iside == 1) {
00259
00260
00261
00262
00263 na = m;
00264
00265 } else {
00266
00267
00268
00269
00270 na = n;
00271
00272 }
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282 i__3 = na;
00283 for (j = 1; j <= i__3; ++j) {
00284 i__4 = na;
00285 for (i__ = 1; i__ <= i__4; ++i__) {
00286 a[i__ + j * a_dim1] = dlarnd_(&
00287 c__2, iseed);
00288 }
00289 }
00290
00291 if (iuplo == 1) {
00292
00293
00294
00295
00296 s_copy(srnamc_1.srnamt, "DGEQRF", (
00297 ftnlen)32, (ftnlen)6);
00298 dgeqrf_(&na, &na, &a[a_offset], lda, &
00299 tau[1], &d_work_dgeqrf__[1],
00300 lda, &info);
00301 } else {
00302
00303
00304
00305
00306 s_copy(srnamc_1.srnamt, "DGELQF", (
00307 ftnlen)32, (ftnlen)6);
00308 dgelqf_(&na, &na, &a[a_offset], lda, &
00309 tau[1], &d_work_dgeqrf__[1],
00310 lda, &info);
00311 }
00312
00313
00314
00315 s_copy(srnamc_1.srnamt, "DTRTTF", (ftnlen)
00316 32, (ftnlen)6);
00317 dtrttf_(cform, uplo, &na, &a[a_offset],
00318 lda, &arf[1], &info);
00319
00320
00321
00322
00323 i__3 = n;
00324 for (j = 1; j <= i__3; ++j) {
00325 i__4 = m;
00326 for (i__ = 1; i__ <= i__4; ++i__) {
00327 b1[i__ + j * b1_dim1] = dlarnd_(&
00328 c__2, iseed);
00329 b2[i__ + j * b2_dim1] = b1[i__ +
00330 j * b1_dim1];
00331 }
00332 }
00333
00334
00335
00336
00337 s_copy(srnamc_1.srnamt, "DTRSM", (ftnlen)
00338 32, (ftnlen)5);
00339 dtrsm_(side, uplo, trans, diag, &m, &n, &
00340 alpha, &a[a_offset], lda, &b1[
00341 b1_offset], lda);
00342
00343
00344
00345
00346 s_copy(srnamc_1.srnamt, "DTFSM", (ftnlen)
00347 32, (ftnlen)5);
00348 dtfsm_(cform, side, uplo, trans, diag, &m,
00349 &n, &alpha, &arf[1], &b2[
00350 b2_offset], lda);
00351
00352
00353
00354 i__3 = n;
00355 for (j = 1; j <= i__3; ++j) {
00356 i__4 = m;
00357 for (i__ = 1; i__ <= i__4; ++i__) {
00358 b1[i__ + j * b1_dim1] = b2[i__ +
00359 j * b2_dim1] - b1[i__ + j
00360 * b1_dim1];
00361 }
00362 }
00363
00364 result[0] = dlange_("I", &m, &n, &b1[
00365 b1_offset], lda, &d_work_dlange__[
00366 1]);
00367
00368
00369 i__3 = max(m,n);
00370 result[0] = result[0] / sqrt(eps) / max(
00371 i__3,1);
00372
00373 if (result[0] >= *thresh) {
00374 if (nfail == 0) {
00375 io___32.ciunit = *nout;
00376 s_wsle(&io___32);
00377 e_wsle();
00378 io___33.ciunit = *nout;
00379 s_wsfe(&io___33);
00380 e_wsfe();
00381 }
00382 io___34.ciunit = *nout;
00383 s_wsfe(&io___34);
00384 do_fio(&c__1, "DTFSM", (ftnlen)5);
00385 do_fio(&c__1, cform, (ftnlen)1);
00386 do_fio(&c__1, side, (ftnlen)1);
00387 do_fio(&c__1, uplo, (ftnlen)1);
00388 do_fio(&c__1, trans, (ftnlen)1);
00389 do_fio(&c__1, diag, (ftnlen)1);
00390 do_fio(&c__1, (char *)&m, (ftnlen)
00391 sizeof(integer));
00392 do_fio(&c__1, (char *)&n, (ftnlen)
00393 sizeof(integer));
00394 do_fio(&c__1, (char *)&result[0], (
00395 ftnlen)sizeof(doublereal));
00396 e_wsfe();
00397 ++nfail;
00398 }
00399
00400
00401 }
00402
00403 }
00404
00405 }
00406
00407 }
00408
00409 }
00410
00411 }
00412
00413 }
00414
00415 }
00416
00417
00418
00419 if (nfail == 0) {
00420 io___35.ciunit = *nout;
00421 s_wsfe(&io___35);
00422 do_fio(&c__1, "DTFSM", (ftnlen)5);
00423 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00424 e_wsfe();
00425 } else {
00426 io___36.ciunit = *nout;
00427 s_wsfe(&io___36);
00428 do_fio(&c__1, "DTFSM", (ftnlen)5);
00429 do_fio(&c__1, (char *)&nfail, (ftnlen)sizeof(integer));
00430 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00431 e_wsfe();
00432 }
00433
00434
00435 return 0;
00436
00437
00438
00439 }