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