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, nunit;
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__0 = 0;
00035 static integer c_n1 = -1;
00036 static integer c__1 = 1;
00037
00038 int schkps_(logical *dotype, integer *nn, integer *nval,
00039 integer *nnb, integer *nbval, integer *nrank, integer *rankval, real *
00040 thresh, logical *tsterr, integer *nmax, real *a, real *afac, real *
00041 perm, integer *piv, real *work, real *rwork, integer *nout)
00042 {
00043
00044
00045 static integer iseedy[4] = { 1988,1989,1990,1991 };
00046 static char uplos[1*2] = "U" "L";
00047
00048
00049 static char fmt_9999[] = "(\002 UPLO = '\002,a1,\002', N =\002,i5,\002, "
00050 "RANK =\002,i3,\002, Diff =\002,i5,\002, NB =\002,i4,\002, type"
00051 " \002,i2,\002, Ratio =\002,g12.5)";
00052
00053
00054 integer i__1, i__2, i__3, i__4;
00055 real r__1;
00056
00057
00058 int s_copy(char *, char *, ftnlen, ftnlen);
00059 integer i_sceiling(real *), s_wsfe(cilist *), do_fio(integer *, char *,
00060 ftnlen), e_wsfe(void);
00061
00062
00063 integer rankdiff, comprank, i__, n, nb, in, kl, ku, lda, inb;
00064 real tol;
00065 integer mode, imat, info, rank;
00066 char path[3], dist[1], uplo[1], type__[1];
00067 integer nrun;
00068 extern int alahd_(integer *, char *);
00069 integer nfail, iseed[4], irank, nimat;
00070 real anorm;
00071 integer iuplo, izero, nerrs;
00072 extern int spst01_(char *, integer *, real *, integer *,
00073 real *, integer *, real *, integer *, integer *, real *, real *,
00074 integer *), slatb5_(char *, integer *, integer *, char *,
00075 integer *, integer *, real *, integer *, real *, char *), alaerh_(char *, char *, integer *, integer *,
00076 char *, integer *, integer *, integer *, integer *, integer *,
00077 integer *, integer *, integer *, integer *), alasum_(char *, integer *, integer *, integer *, integer
00078 *);
00079 real cndnum;
00080 extern int slacpy_(char *, integer *, integer *, real *,
00081 integer *, real *, integer *), xlaenv_(integer *, integer
00082 *), slatmt_(integer *, integer *, char *, integer *, char *, real
00083 *, integer *, real *, real *, integer *, integer *, integer *,
00084 char *, real *, integer *, real *, integer *);
00085 real result;
00086 extern int serrps_(char *, integer *), spstrf_(
00087 char *, integer *, real *, integer *, integer *, integer *, real *
00088 , real *, integer *);
00089
00090
00091 static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
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 --rwork;
00181 --work;
00182 --piv;
00183 --perm;
00184 --afac;
00185 --a;
00186 --rankval;
00187 --nbval;
00188 --nval;
00189 --dotype;
00190
00191
00192
00193
00194
00195
00196
00197 s_copy(path, "Single Precision", (ftnlen)1, (ftnlen)16);
00198 s_copy(path + 1, "PS", (ftnlen)2, (ftnlen)2);
00199 nrun = 0;
00200 nfail = 0;
00201 nerrs = 0;
00202 for (i__ = 1; i__ <= 4; ++i__) {
00203 iseed[i__ - 1] = iseedy[i__ - 1];
00204
00205 }
00206
00207
00208
00209 if (*tsterr) {
00210 serrps_(path, nout);
00211 }
00212 infoc_1.infot = 0;
00213 xlaenv_(&c__2, &c__2);
00214
00215
00216
00217 i__1 = *nn;
00218 for (in = 1; in <= i__1; ++in) {
00219 n = nval[in];
00220 lda = max(n,1);
00221 nimat = 9;
00222 if (n <= 0) {
00223 nimat = 1;
00224 }
00225
00226 izero = 0;
00227 i__2 = nimat;
00228 for (imat = 1; imat <= i__2; ++imat) {
00229
00230
00231
00232 if (! dotype[imat]) {
00233 goto L140;
00234 }
00235
00236
00237
00238 i__3 = *nrank;
00239 for (irank = 1; irank <= i__3; ++irank) {
00240
00241
00242
00243
00244 if ((imat < 3 || imat > 5) && irank > 1) {
00245 goto L130;
00246 }
00247
00248 r__1 = n * (real) rankval[irank] / 100.f;
00249 rank = i_sceiling(&r__1);
00250
00251
00252
00253
00254 for (iuplo = 1; iuplo <= 2; ++iuplo) {
00255 *(unsigned char *)uplo = *(unsigned char *)&uplos[iuplo -
00256 1];
00257
00258
00259
00260
00261 slatb5_(path, &imat, &n, type__, &kl, &ku, &anorm, &mode,
00262 &cndnum, dist);
00263
00264 s_copy(srnamc_1.srnamt, "SLATMT", (ftnlen)32, (ftnlen)6);
00265 slatmt_(&n, &n, dist, iseed, type__, &rwork[1], &mode, &
00266 cndnum, &anorm, &rank, &kl, &ku, uplo, &a[1], &
00267 lda, &work[1], &info);
00268
00269
00270
00271 if (info != 0) {
00272 alaerh_(path, "SLATMT", &info, &c__0, uplo, &n, &n, &
00273 c_n1, &c_n1, &c_n1, &imat, &nfail, &nerrs,
00274 nout);
00275 goto L120;
00276 }
00277
00278
00279
00280 i__4 = *nnb;
00281 for (inb = 1; inb <= i__4; ++inb) {
00282 nb = nbval[inb];
00283 xlaenv_(&c__1, &nb);
00284
00285
00286
00287
00288 slacpy_(uplo, &n, &n, &a[1], &lda, &afac[1], &lda);
00289 s_copy(srnamc_1.srnamt, "SPSTRF", (ftnlen)32, (ftnlen)
00290 6);
00291
00292
00293
00294 tol = -1.f;
00295 spstrf_(uplo, &n, &afac[1], &lda, &piv[1], &comprank,
00296 &tol, &work[1], &info);
00297
00298
00299
00300 if (info < izero || info != izero && rank == n ||
00301 info <= izero && rank < n) {
00302 alaerh_(path, "SPSTRF", &info, &izero, uplo, &n, &
00303 n, &c_n1, &c_n1, &nb, &imat, &nfail, &
00304 nerrs, nout);
00305 goto L110;
00306 }
00307
00308
00309
00310 if (info != 0) {
00311 goto L110;
00312 }
00313
00314
00315
00316
00317
00318 spst01_(uplo, &n, &a[1], &lda, &afac[1], &lda, &perm[
00319 1], &lda, &piv[1], &rwork[1], &result, &
00320 comprank);
00321
00322
00323
00324
00325 if (n == 0) {
00326 comprank = 0;
00327 }
00328 rankdiff = rank - comprank;
00329 if (result >= *thresh) {
00330 if (nfail == 0 && nerrs == 0) {
00331 alahd_(nout, path);
00332 }
00333 io___33.ciunit = *nout;
00334 s_wsfe(&io___33);
00335 do_fio(&c__1, uplo, (ftnlen)1);
00336 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00337 ;
00338 do_fio(&c__1, (char *)&rank, (ftnlen)sizeof(
00339 integer));
00340 do_fio(&c__1, (char *)&rankdiff, (ftnlen)sizeof(
00341 integer));
00342 do_fio(&c__1, (char *)&nb, (ftnlen)sizeof(integer)
00343 );
00344 do_fio(&c__1, (char *)&imat, (ftnlen)sizeof(
00345 integer));
00346 do_fio(&c__1, (char *)&result, (ftnlen)sizeof(
00347 real));
00348 e_wsfe();
00349 ++nfail;
00350 }
00351 ++nrun;
00352 L110:
00353 ;
00354 }
00355
00356 L120:
00357 ;
00358 }
00359 L130:
00360 ;
00361 }
00362 L140:
00363 ;
00364 }
00365
00366 }
00367
00368
00369
00370 alasum_(path, nout, &nfail, &nrun, &nerrs);
00371
00372 return 0;
00373
00374
00375
00376 }