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 integer infot, nout;
00020 logical ok, lerr;
00021 } infoc_;
00022
00023 #define infoc_1 infoc_
00024
00025 struct {
00026 char srnamt[32];
00027 } srnamc_;
00028
00029 #define srnamc_1 srnamc_
00030
00031
00032
00033 static integer c__2 = 2;
00034 static integer c_n1 = -1;
00035 static integer c__0 = 0;
00036 static integer c__1 = 1;
00037
00038 int derrgt_(char *path, integer *nunit)
00039 {
00040
00041 doublereal d__1;
00042
00043
00044 integer s_wsle(cilist *), e_wsle(void);
00045 int s_copy(char *, char *, ftnlen, ftnlen);
00046
00047
00048 doublereal b[2], c__[2], d__[2], e[2], f[2], w[2], x[2];
00049 char c2[2];
00050 doublereal r1[2], r2[2], cf[2], df[2], ef[2];
00051 integer ip[2], iw[2], info;
00052 doublereal rcond, anorm;
00053 extern int alaesm_(char *, logical *, integer *),
00054 dgtcon_(char *, integer *, doublereal *, doublereal *,
00055 doublereal *, doublereal *, integer *, doublereal *, doublereal *,
00056 doublereal *, integer *, integer *);
00057 extern logical lsamen_(integer *, char *, char *);
00058 extern int chkxer_(char *, integer *, integer *, logical
00059 *, logical *), dptcon_(integer *, doublereal *,
00060 doublereal *, doublereal *, doublereal *, doublereal *, integer *)
00061 , dgtrfs_(char *, integer *, integer *, doublereal *, doublereal *
00062 , doublereal *, doublereal *, doublereal *, doublereal *,
00063 doublereal *, integer *, doublereal *, integer *, doublereal *,
00064 integer *, doublereal *, doublereal *, doublereal *, integer *,
00065 integer *), dgttrf_(integer *, doublereal *, doublereal *,
00066 doublereal *, doublereal *, integer *, integer *), dptrfs_(
00067 integer *, integer *, doublereal *, doublereal *, doublereal *,
00068 doublereal *, doublereal *, integer *, doublereal *, integer *,
00069 doublereal *, doublereal *, doublereal *, integer *), dpttrf_(
00070 integer *, doublereal *, doublereal *, integer *), dgttrs_(char *,
00071 integer *, integer *, doublereal *, doublereal *, doublereal *,
00072 doublereal *, integer *, doublereal *, integer *, integer *), dpttrs_(integer *, integer *, doublereal *, doublereal *,
00073 doublereal *, integer *, integer *);
00074
00075
00076 static cilist io___1 = { 0, 0, 0, 0, 0 };
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
00118
00119
00120 infoc_1.nout = *nunit;
00121 io___1.ciunit = infoc_1.nout;
00122 s_wsle(&io___1);
00123 e_wsle();
00124 s_copy(c2, path + 1, (ftnlen)2, (ftnlen)2);
00125 d__[0] = 1.;
00126 d__[1] = 2.;
00127 df[0] = 1.;
00128 df[1] = 2.;
00129 e[0] = 3.;
00130 e[1] = 4.;
00131 ef[0] = 3.;
00132 ef[1] = 4.;
00133 anorm = 1.;
00134 infoc_1.ok = TRUE_;
00135
00136 if (lsamen_(&c__2, c2, "GT")) {
00137
00138
00139
00140
00141
00142 s_copy(srnamc_1.srnamt, "DGTTRF", (ftnlen)32, (ftnlen)6);
00143 infoc_1.infot = 1;
00144 dgttrf_(&c_n1, c__, d__, e, f, ip, &info);
00145 chkxer_("DGTTRF", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00146 infoc_1.ok);
00147
00148
00149
00150 s_copy(srnamc_1.srnamt, "DGTTRS", (ftnlen)32, (ftnlen)6);
00151 infoc_1.infot = 1;
00152 dgttrs_("/", &c__0, &c__0, c__, d__, e, f, ip, x, &c__1, &info);
00153 chkxer_("DGTTRS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00154 infoc_1.ok);
00155 infoc_1.infot = 2;
00156 dgttrs_("N", &c_n1, &c__0, c__, d__, e, f, ip, x, &c__1, &info);
00157 chkxer_("DGTTRS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00158 infoc_1.ok);
00159 infoc_1.infot = 3;
00160 dgttrs_("N", &c__0, &c_n1, c__, d__, e, f, ip, x, &c__1, &info);
00161 chkxer_("DGTTRS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00162 infoc_1.ok);
00163 infoc_1.infot = 10;
00164 dgttrs_("N", &c__2, &c__1, c__, d__, e, f, ip, x, &c__1, &info);
00165 chkxer_("DGTTRS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00166 infoc_1.ok);
00167
00168
00169
00170 s_copy(srnamc_1.srnamt, "DGTRFS", (ftnlen)32, (ftnlen)6);
00171 infoc_1.infot = 1;
00172 dgtrfs_("/", &c__0, &c__0, c__, d__, e, cf, df, ef, f, ip, b, &c__1,
00173 x, &c__1, r1, r2, w, iw, &info);
00174 chkxer_("DGTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00175 infoc_1.ok);
00176 infoc_1.infot = 2;
00177 dgtrfs_("N", &c_n1, &c__0, c__, d__, e, cf, df, ef, f, ip, b, &c__1,
00178 x, &c__1, r1, r2, w, iw, &info);
00179 chkxer_("DGTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00180 infoc_1.ok);
00181 infoc_1.infot = 3;
00182 dgtrfs_("N", &c__0, &c_n1, c__, d__, e, cf, df, ef, f, ip, b, &c__1,
00183 x, &c__1, r1, r2, w, iw, &info);
00184 chkxer_("DGTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00185 infoc_1.ok);
00186 infoc_1.infot = 13;
00187 dgtrfs_("N", &c__2, &c__1, c__, d__, e, cf, df, ef, f, ip, b, &c__1,
00188 x, &c__2, r1, r2, w, iw, &info);
00189 chkxer_("DGTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00190 infoc_1.ok);
00191 infoc_1.infot = 15;
00192 dgtrfs_("N", &c__2, &c__1, c__, d__, e, cf, df, ef, f, ip, b, &c__2,
00193 x, &c__1, r1, r2, w, iw, &info);
00194 chkxer_("DGTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00195 infoc_1.ok);
00196
00197
00198
00199 s_copy(srnamc_1.srnamt, "DGTCON", (ftnlen)32, (ftnlen)6);
00200 infoc_1.infot = 1;
00201 dgtcon_("/", &c__0, c__, d__, e, f, ip, &anorm, &rcond, w, iw, &info);
00202 chkxer_("DGTCON", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00203 infoc_1.ok);
00204 infoc_1.infot = 2;
00205 dgtcon_("I", &c_n1, c__, d__, e, f, ip, &anorm, &rcond, w, iw, &info);
00206 chkxer_("DGTCON", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00207 infoc_1.ok);
00208 infoc_1.infot = 8;
00209 d__1 = -anorm;
00210 dgtcon_("I", &c__0, c__, d__, e, f, ip, &d__1, &rcond, w, iw, &info);
00211 chkxer_("DGTCON", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00212 infoc_1.ok);
00213
00214 } else if (lsamen_(&c__2, c2, "PT")) {
00215
00216
00217
00218
00219
00220
00221 s_copy(srnamc_1.srnamt, "DPTTRF", (ftnlen)32, (ftnlen)6);
00222 infoc_1.infot = 1;
00223 dpttrf_(&c_n1, d__, e, &info);
00224 chkxer_("DPTTRF", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00225 infoc_1.ok);
00226
00227
00228
00229 s_copy(srnamc_1.srnamt, "DPTTRS", (ftnlen)32, (ftnlen)6);
00230 infoc_1.infot = 1;
00231 dpttrs_(&c_n1, &c__0, d__, e, x, &c__1, &info);
00232 chkxer_("DPTTRS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00233 infoc_1.ok);
00234 infoc_1.infot = 2;
00235 dpttrs_(&c__0, &c_n1, d__, e, x, &c__1, &info);
00236 chkxer_("DPTTRS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00237 infoc_1.ok);
00238 infoc_1.infot = 6;
00239 dpttrs_(&c__2, &c__1, d__, e, x, &c__1, &info);
00240 chkxer_("DPTTRS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00241 infoc_1.ok);
00242
00243
00244
00245 s_copy(srnamc_1.srnamt, "DPTRFS", (ftnlen)32, (ftnlen)6);
00246 infoc_1.infot = 1;
00247 dptrfs_(&c_n1, &c__0, d__, e, df, ef, b, &c__1, x, &c__1, r1, r2, w, &
00248 info);
00249 chkxer_("DPTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00250 infoc_1.ok);
00251 infoc_1.infot = 2;
00252 dptrfs_(&c__0, &c_n1, d__, e, df, ef, b, &c__1, x, &c__1, r1, r2, w, &
00253 info);
00254 chkxer_("DPTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00255 infoc_1.ok);
00256 infoc_1.infot = 8;
00257 dptrfs_(&c__2, &c__1, d__, e, df, ef, b, &c__1, x, &c__2, r1, r2, w, &
00258 info);
00259 chkxer_("DPTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00260 infoc_1.ok);
00261 infoc_1.infot = 10;
00262 dptrfs_(&c__2, &c__1, d__, e, df, ef, b, &c__2, x, &c__1, r1, r2, w, &
00263 info);
00264 chkxer_("DPTRFS", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00265 infoc_1.ok);
00266
00267
00268
00269 s_copy(srnamc_1.srnamt, "DPTCON", (ftnlen)32, (ftnlen)6);
00270 infoc_1.infot = 1;
00271 dptcon_(&c_n1, d__, e, &anorm, &rcond, w, &info);
00272 chkxer_("DPTCON", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00273 infoc_1.ok);
00274 infoc_1.infot = 4;
00275 d__1 = -anorm;
00276 dptcon_(&c__0, d__, e, &d__1, &rcond, w, &info);
00277 chkxer_("DPTCON", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
00278 infoc_1.ok);
00279 }
00280
00281
00282
00283 alaesm_(path, &infoc_1.ok, &infoc_1.nout);
00284
00285 return 0;
00286
00287
00288
00289 }