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 ddrvrf2_(integer *nout, integer *nn, integer *nval,
00030 doublereal *a, integer *lda, doublereal *arf, doublereal *ap,
00031 doublereal *asav)
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
00039
00040 static char fmt_9999[] = "(1x,\002 *** Error(s) while testing the RFP co"
00041 "nvertion\002,\002 routines ***\002)";
00042 static char fmt_9998[] = "(1x,\002 Error in RFP,convertion routines "
00043 "N=\002,i5,\002 UPLO='\002,a1,\002', FORM ='\002,a1,\002'\002)";
00044 static char fmt_9997[] = "(1x,\002All tests for the RFP convertion routi"
00045 "nes passed (\002,i5,\002 tests run)\002)";
00046 static char fmt_9996[] = "(1x,\002RFP convertion routines:\002,i5,\002 o"
00047 "ut of \002,i5,\002 error message recorded\002)";
00048
00049
00050 integer a_dim1, a_offset, asav_dim1, asav_offset, i__1, i__2, i__3;
00051
00052
00053 int s_copy(char *, char *, ftnlen, ftnlen);
00054 integer s_wsle(cilist *), e_wsle(void), s_wsfe(cilist *), e_wsfe(void),
00055 do_fio(integer *, char *, ftnlen);
00056
00057
00058 integer i__, j, n;
00059 logical ok1, ok2;
00060 integer iin, info;
00061 char uplo[1];
00062 integer nrun, iseed[4];
00063 char cform[1];
00064 integer iform;
00065 logical lower;
00066 integer iuplo, nerrs;
00067 extern doublereal dlarnd_(integer *, integer *);
00068 extern int dtfttp_(char *, char *, integer *, doublereal
00069 *, doublereal *, integer *), dtpttf_(char *, char
00070 *, integer *, doublereal *, doublereal *, integer *), dtfttr_(char *, char *, integer *, doublereal *,
00071 doublereal *, integer *, integer *), dtrttf_(char
00072 *, char *, integer *, doublereal *, integer *, doublereal *,
00073 integer *), dtrttp_(char *, integer *, doublereal
00074 *, integer *, doublereal *, integer *), dtpttr_(char *,
00075 integer *, doublereal *, doublereal *, integer *, integer *);
00076
00077
00078 static cilist io___19 = { 0, 0, 0, 0, 0 };
00079 static cilist io___20 = { 0, 0, 0, fmt_9999, 0 };
00080 static cilist io___21 = { 0, 0, 0, fmt_9998, 0 };
00081 static cilist io___22 = { 0, 0, 0, fmt_9997, 0 };
00082 static cilist io___23 = { 0, 0, 0, fmt_9996, 0 };
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
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 --nval;
00140 asav_dim1 = *lda;
00141 asav_offset = 1 + asav_dim1;
00142 asav -= asav_offset;
00143 a_dim1 = *lda;
00144 a_offset = 1 + a_dim1;
00145 a -= a_offset;
00146 --arf;
00147 --ap;
00148
00149
00150
00151
00152
00153
00154
00155 nrun = 0;
00156 nerrs = 0;
00157 info = 0;
00158 for (i__ = 1; i__ <= 4; ++i__) {
00159 iseed[i__ - 1] = iseedy[i__ - 1];
00160
00161 }
00162
00163 i__1 = *nn;
00164 for (iin = 1; iin <= i__1; ++iin) {
00165
00166 n = nval[iin];
00167
00168
00169
00170 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00171
00172 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00173 lower = TRUE_;
00174 if (iuplo == 1) {
00175 lower = FALSE_;
00176 }
00177
00178
00179
00180 for (iform = 1; iform <= 2; ++iform) {
00181
00182 *(unsigned char *)cform = *(unsigned char *)&forms[iform - 1];
00183
00184 ++nrun;
00185
00186 i__2 = n;
00187 for (j = 1; j <= i__2; ++j) {
00188 i__3 = n;
00189 for (i__ = 1; i__ <= i__3; ++i__) {
00190 a[i__ + j * a_dim1] = dlarnd_(&c__2, iseed);
00191 }
00192 }
00193
00194 s_copy(srnamc_1.srnamt, "DTRTTF", (ftnlen)32, (ftnlen)6);
00195 dtrttf_(cform, uplo, &n, &a[a_offset], lda, &arf[1], &info);
00196
00197 s_copy(srnamc_1.srnamt, "DTFTTP", (ftnlen)32, (ftnlen)6);
00198 dtfttp_(cform, uplo, &n, &arf[1], &ap[1], &info);
00199
00200 s_copy(srnamc_1.srnamt, "DTPTTR", (ftnlen)32, (ftnlen)6);
00201 dtpttr_(uplo, &n, &ap[1], &asav[asav_offset], lda, &info);
00202
00203 ok1 = TRUE_;
00204 if (lower) {
00205 i__2 = n;
00206 for (j = 1; j <= i__2; ++j) {
00207 i__3 = n;
00208 for (i__ = j; i__ <= i__3; ++i__) {
00209 if (a[i__ + j * a_dim1] != asav[i__ + j *
00210 asav_dim1]) {
00211 ok1 = FALSE_;
00212 }
00213 }
00214 }
00215 } else {
00216 i__2 = n;
00217 for (j = 1; j <= i__2; ++j) {
00218 i__3 = j;
00219 for (i__ = 1; i__ <= i__3; ++i__) {
00220 if (a[i__ + j * a_dim1] != asav[i__ + j *
00221 asav_dim1]) {
00222 ok1 = FALSE_;
00223 }
00224 }
00225 }
00226 }
00227
00228 ++nrun;
00229
00230 s_copy(srnamc_1.srnamt, "DTRTTP", (ftnlen)32, (ftnlen)6);
00231 dtrttp_(uplo, &n, &a[a_offset], lda, &ap[1], &info)
00232 ;
00233
00234 s_copy(srnamc_1.srnamt, "DTPTTF", (ftnlen)32, (ftnlen)6);
00235 dtpttf_(cform, uplo, &n, &ap[1], &arf[1], &info);
00236
00237 s_copy(srnamc_1.srnamt, "DTFTTR", (ftnlen)32, (ftnlen)6);
00238 dtfttr_(cform, uplo, &n, &arf[1], &asav[asav_offset], lda, &
00239 info);
00240
00241 ok2 = TRUE_;
00242 if (lower) {
00243 i__2 = n;
00244 for (j = 1; j <= i__2; ++j) {
00245 i__3 = n;
00246 for (i__ = j; i__ <= i__3; ++i__) {
00247 if (a[i__ + j * a_dim1] != asav[i__ + j *
00248 asav_dim1]) {
00249 ok2 = FALSE_;
00250 }
00251 }
00252 }
00253 } else {
00254 i__2 = n;
00255 for (j = 1; j <= i__2; ++j) {
00256 i__3 = j;
00257 for (i__ = 1; i__ <= i__3; ++i__) {
00258 if (a[i__ + j * a_dim1] != asav[i__ + j *
00259 asav_dim1]) {
00260 ok2 = FALSE_;
00261 }
00262 }
00263 }
00264 }
00265
00266 if (! ok1 || ! ok2) {
00267 if (nerrs == 0) {
00268 io___19.ciunit = *nout;
00269 s_wsle(&io___19);
00270 e_wsle();
00271 io___20.ciunit = *nout;
00272 s_wsfe(&io___20);
00273 e_wsfe();
00274 }
00275 io___21.ciunit = *nout;
00276 s_wsfe(&io___21);
00277 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00278 do_fio(&c__1, uplo, (ftnlen)1);
00279 do_fio(&c__1, cform, (ftnlen)1);
00280 e_wsfe();
00281 ++nerrs;
00282 }
00283
00284
00285 }
00286
00287 }
00288
00289 }
00290
00291
00292
00293 if (nerrs == 0) {
00294 io___22.ciunit = *nout;
00295 s_wsfe(&io___22);
00296 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00297 e_wsfe();
00298 } else {
00299 io___23.ciunit = *nout;
00300 s_wsfe(&io___23);
00301 do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00302 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00303 e_wsfe();
00304 }
00305
00306
00307 return 0;
00308
00309
00310
00311 }