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