00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static integer c__3 = 3;
00019 static integer c__1 = 1;
00020 static integer c__5 = 5;
00021 static integer c__20 = 20;
00022
00023 int dchkbk_(integer *nin, integer *nout)
00024 {
00025
00026 static char fmt_9999[] = "(1x,\002.. test output of DGEBAK .. \002)";
00027 static char fmt_9998[] = "(1x,\002value of largest test error "
00028 " = \002,d12.3)";
00029 static char fmt_9997[] = "(1x,\002example number where info is not zero "
00030 " = \002,i4)";
00031 static char fmt_9996[] = "(1x,\002example number having largest error "
00032 " = \002,i4)";
00033 static char fmt_9995[] = "(1x,\002number of examples where info is not 0"
00034 " = \002,i4)";
00035 static char fmt_9994[] = "(1x,\002total number of examples tested "
00036 " = \002,i4)";
00037
00038
00039 integer i__1, i__2;
00040 doublereal d__1, d__2;
00041
00042
00043 integer s_rsle(cilist *), do_lio(integer *, integer *, char *, ftnlen),
00044 e_rsle(void), s_wsfe(cilist *), e_wsfe(void), do_fio(integer *,
00045 char *, ftnlen);
00046
00047
00048 doublereal e[400] ;
00049 integer i__, j, n;
00050 doublereal x;
00051 integer ihi;
00052 doublereal ein[400] ;
00053 integer ilo;
00054 doublereal eps;
00055 integer knt, info, lmax[2];
00056 doublereal rmax, vmax, scale[20];
00057 integer ninfo;
00058 extern int dgebak_(char *, char *, integer *, integer *,
00059 integer *, doublereal *, integer *, doublereal *, integer *,
00060 integer *);
00061 extern doublereal dlamch_(char *);
00062 doublereal safmin;
00063
00064
00065 static cilist io___7 = { 0, 0, 0, 0, 0 };
00066 static cilist io___11 = { 0, 0, 0, 0, 0 };
00067 static cilist io___14 = { 0, 0, 0, 0, 0 };
00068 static cilist io___17 = { 0, 0, 0, 0, 0 };
00069 static cilist io___22 = { 0, 0, 0, fmt_9999, 0 };
00070 static cilist io___23 = { 0, 0, 0, fmt_9998, 0 };
00071 static cilist io___24 = { 0, 0, 0, fmt_9997, 0 };
00072 static cilist io___25 = { 0, 0, 0, fmt_9996, 0 };
00073 static cilist io___26 = { 0, 0, 0, fmt_9995, 0 };
00074 static cilist io___27 = { 0, 0, 0, fmt_9994, 0 };
00075
00076
00077
00078
00079
00080
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 lmax[0] = 0;
00118 lmax[1] = 0;
00119 ninfo = 0;
00120 knt = 0;
00121 rmax = 0.;
00122 eps = dlamch_("E");
00123 safmin = dlamch_("S");
00124
00125 L10:
00126
00127 io___7.ciunit = *nin;
00128 s_rsle(&io___7);
00129 do_lio(&c__3, &c__1, (char *)&n, (ftnlen)sizeof(integer));
00130 do_lio(&c__3, &c__1, (char *)&ilo, (ftnlen)sizeof(integer));
00131 do_lio(&c__3, &c__1, (char *)&ihi, (ftnlen)sizeof(integer));
00132 e_rsle();
00133 if (n == 0) {
00134 goto L60;
00135 }
00136
00137 io___11.ciunit = *nin;
00138 s_rsle(&io___11);
00139 i__1 = n;
00140 for (i__ = 1; i__ <= i__1; ++i__) {
00141 do_lio(&c__5, &c__1, (char *)&scale[i__ - 1], (ftnlen)sizeof(
00142 doublereal));
00143 }
00144 e_rsle();
00145 i__1 = n;
00146 for (i__ = 1; i__ <= i__1; ++i__) {
00147 io___14.ciunit = *nin;
00148 s_rsle(&io___14);
00149 i__2 = n;
00150 for (j = 1; j <= i__2; ++j) {
00151 do_lio(&c__5, &c__1, (char *)&e[i__ + j * 20 - 21], (ftnlen)
00152 sizeof(doublereal));
00153 }
00154 e_rsle();
00155
00156 }
00157
00158 i__1 = n;
00159 for (i__ = 1; i__ <= i__1; ++i__) {
00160 io___17.ciunit = *nin;
00161 s_rsle(&io___17);
00162 i__2 = n;
00163 for (j = 1; j <= i__2; ++j) {
00164 do_lio(&c__5, &c__1, (char *)&ein[i__ + j * 20 - 21], (ftnlen)
00165 sizeof(doublereal));
00166 }
00167 e_rsle();
00168
00169 }
00170
00171 ++knt;
00172 dgebak_("B", "R", &n, &ilo, &ihi, scale, &n, e, &c__20, &info);
00173
00174 if (info != 0) {
00175 ++ninfo;
00176 lmax[0] = knt;
00177 }
00178
00179 vmax = 0.;
00180 i__1 = n;
00181 for (i__ = 1; i__ <= i__1; ++i__) {
00182 i__2 = n;
00183 for (j = 1; j <= i__2; ++j) {
00184 x = (d__1 = e[i__ + j * 20 - 21] - ein[i__ + j * 20 - 21], abs(
00185 d__1)) / eps;
00186 if ((d__1 = e[i__ + j * 20 - 21], abs(d__1)) > safmin) {
00187 x /= (d__2 = e[i__ + j * 20 - 21], abs(d__2));
00188 }
00189 vmax = max(vmax,x);
00190
00191 }
00192
00193 }
00194
00195 if (vmax > rmax) {
00196 lmax[1] = knt;
00197 rmax = vmax;
00198 }
00199
00200 goto L10;
00201
00202 L60:
00203
00204 io___22.ciunit = *nout;
00205 s_wsfe(&io___22);
00206 e_wsfe();
00207
00208 io___23.ciunit = *nout;
00209 s_wsfe(&io___23);
00210 do_fio(&c__1, (char *)&rmax, (ftnlen)sizeof(doublereal));
00211 e_wsfe();
00212 io___24.ciunit = *nout;
00213 s_wsfe(&io___24);
00214 do_fio(&c__1, (char *)&lmax[0], (ftnlen)sizeof(integer));
00215 e_wsfe();
00216 io___25.ciunit = *nout;
00217 s_wsfe(&io___25);
00218 do_fio(&c__1, (char *)&lmax[1], (ftnlen)sizeof(integer));
00219 e_wsfe();
00220 io___26.ciunit = *nout;
00221 s_wsfe(&io___26);
00222 do_fio(&c__1, (char *)&ninfo, (ftnlen)sizeof(integer));
00223 e_wsfe();
00224 io___27.ciunit = *nout;
00225 s_wsfe(&io___27);
00226 do_fio(&c__1, (char *)&knt, (ftnlen)sizeof(integer));
00227 e_wsfe();
00228
00229 return 0;
00230
00231
00232
00233 }