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