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__8 = 8;
00019 static integer c__1 = 1;
00020 static integer c__0 = 0;
00021
00022 int sckgsv_(integer *nm, integer *mval, integer *pval,
00023 integer *nval, integer *nmats, integer *iseed, real *thresh, integer *
00024 nmax, real *a, real *af, real *b, real *bf, real *u, real *v, real *q,
00025 real *alpha, real *beta, real *r__, integer *iwork, real *work, real
00026 *rwork, integer *nin, integer *nout, integer *info)
00027 {
00028
00029 static char fmt_9999[] = "(\002 SLATMS in SCKGSV INFO = \002,i5)";
00030 static char fmt_9998[] = "(\002 M=\002,i4,\002 P=\002,i4,\002, N=\002,"
00031 "i4,\002, type \002,i2,\002, test \002,i2,\002, ratio=\002,g13.6)";
00032
00033
00034 integer i__1, i__2;
00035
00036
00037 int s_copy(char *, char *, ftnlen, ftnlen);
00038 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00039
00040
00041 integer i__, m, n, p, im, nt, lda, ldb, kla, klb, kua, kub, ldq, ldr, ldu,
00042 ldv, imat;
00043 char path[3], type__[1];
00044 integer nrun, modea, modeb, nfail;
00045 char dista[1], distb[1];
00046 integer iinfo;
00047 real anorm, bnorm;
00048 integer lwork;
00049 extern int slatb9_(char *, integer *, integer *, integer
00050 *, integer *, char *, integer *, integer *, integer *, integer *,
00051 real *, real *, integer *, integer *, real *, real *, char *,
00052 char *), alahdg_(integer *, char *
00053 );
00054 real cndnma, cndnmb;
00055 extern int alareq_(char *, integer *, logical *, integer
00056 *, integer *, integer *), alasum_(char *, integer *,
00057 integer *, integer *, integer *), slatms_(integer *,
00058 integer *, char *, integer *, char *, real *, integer *, real *,
00059 real *, integer *, integer *, char *, real *, integer *, real *,
00060 integer *);
00061 logical dotype[8], firstt;
00062 real result[7];
00063 extern int sgsvts_(integer *, integer *, integer *, real
00064 *, real *, integer *, real *, real *, integer *, real *, integer *
00065 , real *, integer *, real *, integer *, real *, real *, real *,
00066 integer *, integer *, real *, integer *, real *, real *);
00067
00068
00069 static cilist io___32 = { 0, 0, 0, fmt_9999, 0 };
00070 static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
00071 static cilist io___37 = { 0, 0, 0, fmt_9998, 0 };
00072
00073
00074
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
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
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182 --rwork;
00183 --work;
00184 --iwork;
00185 --r__;
00186 --beta;
00187 --alpha;
00188 --q;
00189 --v;
00190 --u;
00191 --bf;
00192 --b;
00193 --af;
00194 --a;
00195 --iseed;
00196 --nval;
00197 --pval;
00198 --mval;
00199
00200
00201 s_copy(path, "GSV", (ftnlen)3, (ftnlen)3);
00202 *info = 0;
00203 nrun = 0;
00204 nfail = 0;
00205 firstt = TRUE_;
00206 alareq_(path, nmats, dotype, &c__8, nin, nout);
00207 lda = *nmax;
00208 ldb = *nmax;
00209 ldu = *nmax;
00210 ldv = *nmax;
00211 ldq = *nmax;
00212 ldr = *nmax;
00213 lwork = *nmax * *nmax;
00214
00215
00216
00217 i__1 = *nm;
00218 for (im = 1; im <= i__1; ++im) {
00219 m = mval[im];
00220 p = pval[im];
00221 n = nval[im];
00222
00223 for (imat = 1; imat <= 8; ++imat) {
00224
00225
00226
00227 if (! dotype[imat - 1]) {
00228 goto L20;
00229 }
00230
00231
00232
00233
00234 slatb9_(path, &imat, &m, &p, &n, type__, &kla, &kua, &klb, &kub, &
00235 anorm, &bnorm, &modea, &modeb, &cndnma, &cndnmb, dista,
00236 distb);
00237
00238
00239
00240 slatms_(&m, &n, dista, &iseed[1], type__, &rwork[1], &modea, &
00241 cndnma, &anorm, &kla, &kua, "No packing", &a[1], &lda, &
00242 work[1], &iinfo);
00243 if (iinfo != 0) {
00244 io___32.ciunit = *nout;
00245 s_wsfe(&io___32);
00246 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00247 e_wsfe();
00248 *info = abs(iinfo);
00249 goto L20;
00250 }
00251
00252 slatms_(&p, &n, distb, &iseed[1], type__, &rwork[1], &modeb, &
00253 cndnmb, &bnorm, &klb, &kub, "No packing", &b[1], &ldb, &
00254 work[1], &iinfo);
00255 if (iinfo != 0) {
00256 io___33.ciunit = *nout;
00257 s_wsfe(&io___33);
00258 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00259 e_wsfe();
00260 *info = abs(iinfo);
00261 goto L20;
00262 }
00263
00264 nt = 6;
00265
00266 sgsvts_(&m, &p, &n, &a[1], &af[1], &lda, &b[1], &bf[1], &ldb, &u[
00267 1], &ldu, &v[1], &ldv, &q[1], &ldq, &alpha[1], &beta[1], &
00268 r__[1], &ldr, &iwork[1], &work[1], &lwork, &rwork[1],
00269 result);
00270
00271
00272
00273
00274 i__2 = nt;
00275 for (i__ = 1; i__ <= i__2; ++i__) {
00276 if (result[i__ - 1] >= *thresh) {
00277 if (nfail == 0 && firstt) {
00278 firstt = FALSE_;
00279 alahdg_(nout, path);
00280 }
00281 io___37.ciunit = *nout;
00282 s_wsfe(&io___37);
00283 do_fio(&c__1, (char *)&m, (ftnlen)sizeof(integer));
00284 do_fio(&c__1, (char *)&p, (ftnlen)sizeof(integer));
00285 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00286 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(integer));
00287 do_fio(&c__1, (char *)&i__, (ftnlen)sizeof(integer));
00288 do_fio(&c__1, (char *)&result[i__ - 1], (ftnlen)sizeof(
00289 real));
00290 e_wsfe();
00291 ++nfail;
00292 }
00293
00294 }
00295 nrun += nt;
00296 L20:
00297 ;
00298 }
00299
00300 }
00301
00302
00303
00304 alasum_(path, nout, &nfail, &nrun, &c__0);
00305
00306 return 0;
00307
00308
00309
00310 }