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