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__4 = 4;
00027 static integer c__1 = 1;
00028
00029 int cdrvrf2_(integer *nout, integer *nn, integer *nval,
00030 complex *a, integer *lda, complex *arf, complex *ap, complex *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" "C";
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, i__4,
00050 i__5;
00051 complex q__1;
00052
00053
00054 int s_copy(char *, char *, ftnlen, ftnlen);
00055 integer s_wsle(cilist *), e_wsle(void), s_wsfe(cilist *), e_wsfe(void),
00056 do_fio(integer *, char *, ftnlen);
00057
00058
00059 integer i__, j, n;
00060 logical ok1, ok2;
00061 integer iin, info;
00062 char uplo[1];
00063 integer nrun, iseed[4];
00064 char cform[1];
00065 integer iform;
00066 logical lower;
00067 integer iuplo, nerrs;
00068 extern VOID clarnd_(complex *, integer *, integer *);
00069 extern int ctfttp_(char *, char *, integer *, complex *,
00070 complex *, integer *), ctpttf_(char *, char *,
00071 integer *, complex *, complex *, integer *),
00072 ctfttr_(char *, char *, integer *, complex *, complex *, integer *
00073 , integer *), ctrttf_(char *, char *, integer *,
00074 complex *, integer *, complex *, integer *),
00075 ctrttp_(char *, integer *, complex *, integer *, complex *,
00076 integer *), ctpttr_(char *, integer *, complex *, complex
00077 *, integer *, integer *);
00078
00079
00080 static cilist io___19 = { 0, 0, 0, 0, 0 };
00081 static cilist io___20 = { 0, 0, 0, fmt_9999, 0 };
00082 static cilist io___21 = { 0, 0, 0, fmt_9998, 0 };
00083 static cilist io___22 = { 0, 0, 0, fmt_9997, 0 };
00084 static cilist io___23 = { 0, 0, 0, fmt_9996, 0 };
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
00140
00141 --nval;
00142 asav_dim1 = *lda;
00143 asav_offset = 1 + asav_dim1;
00144 asav -= asav_offset;
00145 a_dim1 = *lda;
00146 a_offset = 1 + a_dim1;
00147 a -= a_offset;
00148 --arf;
00149 --ap;
00150
00151
00152
00153
00154
00155
00156
00157 nrun = 0;
00158 nerrs = 0;
00159 info = 0;
00160 for (i__ = 1; i__ <= 4; ++i__) {
00161 iseed[i__ - 1] = iseedy[i__ - 1];
00162
00163 }
00164
00165 i__1 = *nn;
00166 for (iin = 1; iin <= i__1; ++iin) {
00167
00168 n = nval[iin];
00169
00170
00171
00172 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00173
00174 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo - 1];
00175 lower = TRUE_;
00176 if (iuplo == 1) {
00177 lower = FALSE_;
00178 }
00179
00180
00181
00182 for (iform = 1; iform <= 2; ++iform) {
00183
00184 *(unsigned char *)cform = *(unsigned char *)&forms[iform - 1];
00185
00186 ++nrun;
00187
00188 i__2 = n;
00189 for (j = 1; j <= i__2; ++j) {
00190 i__3 = n;
00191 for (i__ = 1; i__ <= i__3; ++i__) {
00192 i__4 = i__ + j * a_dim1;
00193 clarnd_(&q__1, &c__4, iseed);
00194 a[i__4].r = q__1.r, a[i__4].i = q__1.i;
00195 }
00196 }
00197
00198 s_copy(srnamc_1.srnamt, "CTRTTF", (ftnlen)32, (ftnlen)6);
00199 ctrttf_(cform, uplo, &n, &a[a_offset], lda, &arf[1], &info);
00200
00201 s_copy(srnamc_1.srnamt, "CTFTTP", (ftnlen)32, (ftnlen)6);
00202 ctfttp_(cform, uplo, &n, &arf[1], &ap[1], &info);
00203
00204 s_copy(srnamc_1.srnamt, "CTPTTR", (ftnlen)32, (ftnlen)6);
00205 ctpttr_(uplo, &n, &ap[1], &asav[asav_offset], lda, &info);
00206
00207 ok1 = TRUE_;
00208 if (lower) {
00209 i__2 = n;
00210 for (j = 1; j <= i__2; ++j) {
00211 i__3 = n;
00212 for (i__ = j; i__ <= i__3; ++i__) {
00213 i__4 = i__ + j * a_dim1;
00214 i__5 = i__ + j * asav_dim1;
00215 if (a[i__4].r != asav[i__5].r || a[i__4].i !=
00216 asav[i__5].i) {
00217 ok1 = FALSE_;
00218 }
00219 }
00220 }
00221 } else {
00222 i__2 = n;
00223 for (j = 1; j <= i__2; ++j) {
00224 i__3 = j;
00225 for (i__ = 1; i__ <= i__3; ++i__) {
00226 i__4 = i__ + j * a_dim1;
00227 i__5 = i__ + j * asav_dim1;
00228 if (a[i__4].r != asav[i__5].r || a[i__4].i !=
00229 asav[i__5].i) {
00230 ok1 = FALSE_;
00231 }
00232 }
00233 }
00234 }
00235
00236 ++nrun;
00237
00238 s_copy(srnamc_1.srnamt, "CTRTTP", (ftnlen)32, (ftnlen)6);
00239 ctrttp_(uplo, &n, &a[a_offset], lda, &ap[1], &info)
00240 ;
00241
00242 s_copy(srnamc_1.srnamt, "CTPTTF", (ftnlen)32, (ftnlen)6);
00243 ctpttf_(cform, uplo, &n, &ap[1], &arf[1], &info);
00244
00245 s_copy(srnamc_1.srnamt, "CTFTTR", (ftnlen)32, (ftnlen)6);
00246 ctfttr_(cform, uplo, &n, &arf[1], &asav[asav_offset], lda, &
00247 info);
00248
00249 ok2 = TRUE_;
00250 if (lower) {
00251 i__2 = n;
00252 for (j = 1; j <= i__2; ++j) {
00253 i__3 = n;
00254 for (i__ = j; i__ <= i__3; ++i__) {
00255 i__4 = i__ + j * a_dim1;
00256 i__5 = i__ + j * asav_dim1;
00257 if (a[i__4].r != asav[i__5].r || a[i__4].i !=
00258 asav[i__5].i) {
00259 ok2 = FALSE_;
00260 }
00261 }
00262 }
00263 } else {
00264 i__2 = n;
00265 for (j = 1; j <= i__2; ++j) {
00266 i__3 = j;
00267 for (i__ = 1; i__ <= i__3; ++i__) {
00268 i__4 = i__ + j * a_dim1;
00269 i__5 = i__ + j * asav_dim1;
00270 if (a[i__4].r != asav[i__5].r || a[i__4].i !=
00271 asav[i__5].i) {
00272 ok2 = FALSE_;
00273 }
00274 }
00275 }
00276 }
00277
00278 if (! ok1 || ! ok2) {
00279 if (nerrs == 0) {
00280 io___19.ciunit = *nout;
00281 s_wsle(&io___19);
00282 e_wsle();
00283 io___20.ciunit = *nout;
00284 s_wsfe(&io___20);
00285 e_wsfe();
00286 }
00287 io___21.ciunit = *nout;
00288 s_wsfe(&io___21);
00289 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00290 do_fio(&c__1, uplo, (ftnlen)1);
00291 do_fio(&c__1, cform, (ftnlen)1);
00292 e_wsfe();
00293 ++nerrs;
00294 }
00295
00296
00297 }
00298
00299 }
00300
00301 }
00302
00303
00304
00305 if (nerrs == 0) {
00306 io___22.ciunit = *nout;
00307 s_wsfe(&io___22);
00308 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00309 e_wsfe();
00310 } else {
00311 io___23.ciunit = *nout;
00312 s_wsfe(&io___23);
00313 do_fio(&c__1, (char *)&nerrs, (ftnlen)sizeof(integer));
00314 do_fio(&c__1, (char *)&nrun, (ftnlen)sizeof(integer));
00315 e_wsfe();
00316 }
00317
00318
00319 return 0;
00320
00321
00322
00323 }