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