154
155
156
157
158
159
160 REAL THRESH
161 INTEGER NMAX, NN, NNB, NOUT, NRANK
162 LOGICAL TSTERR
163
164
165 REAL A( * ), AFAC( * ), PERM( * ), RWORK( * ),
166 $ WORK( * )
167 INTEGER NBVAL( * ), NVAL( * ), PIV( * ), RANKVAL( * )
168 LOGICAL DOTYPE( * )
169
170
171
172
173
174 REAL ONE
175 parameter( one = 1.0e+0 )
176 INTEGER NTYPES
177 parameter( ntypes = 9 )
178
179
180 REAL ANORM, CNDNUM, RESULT, TOL
181 INTEGER COMPRANK, I, IMAT, IN, INB, INFO, IRANK, IUPLO,
182 $ IZERO, KL, KU, LDA, MODE, N, NB, NERRS, NFAIL,
183 $ NIMAT, NRUN, RANK, RANKDIFF
184 CHARACTER DIST, TYPE, UPLO
185 CHARACTER*3 PATH
186
187
188 INTEGER ISEED( 4 ), ISEEDY( 4 )
189 CHARACTER UPLOS( 2 )
190
191
194
195
196 INTEGER INFOT, NUNIT
197 LOGICAL LERR, OK
198 CHARACTER*32 SRNAMT
199
200
201 COMMON / infoc / infot, nunit, ok, lerr
202 COMMON / srnamc / srnamt
203
204
205 INTRINSIC max, real, ceiling
206
207
208 DATA iseedy / 1988, 1989, 1990, 1991 /
209 DATA uplos / 'U', 'L' /
210
211
212
213
214
215 path( 1: 1 ) = 'Single Precision'
216 path( 2: 3 ) = 'PS'
217 nrun = 0
218 nfail = 0
219 nerrs = 0
220 DO 100 i = 1, 4
221 iseed( i ) = iseedy( i )
222 100 CONTINUE
223
224
225
226 IF( tsterr )
227 $
CALL serrps( path, nout )
228 infot = 0
230
231
232
233 DO 150 in = 1, nn
234 n = nval( in )
235 lda = max( n, 1 )
236 nimat = ntypes
237 IF( n.LE.0 )
238 $ nimat = 1
239
240 izero = 0
241 DO 140 imat = 1, nimat
242
243
244
245 IF( .NOT.dotype( imat ) )
246 $ GO TO 140
247
248
249
250 DO 130 irank = 1, nrank
251
252
253
254
255 IF( ( imat.LT.3 .OR. imat.GT.5 ) .AND. irank.GT.1 )
256 $ GO TO 130
257
258 rank = ceiling( ( n * real( rankval( irank ) ) )
259 $ / 100.e+0 )
260
261
262
263
264 DO 120 iuplo = 1, 2
265 uplo = uplos( iuplo )
266
267
268
269
270 CALL slatb5( path, imat, n,
TYPE, KL, KU, ANORM,
271 $ MODE, CNDNUM, DIST )
272
273 srnamt = 'SLATMT'
274 CALL slatmt( n, n, dist, iseed,
TYPE, RWORK, MODE,
275 $ CNDNUM, ANORM, RANK, KL, KU, UPLO, A,
276 $ LDA, WORK, INFO )
277
278
279
280 IF( info.NE.0 ) THEN
281 CALL alaerh( path,
'SLATMT', info, 0, uplo, n,
282 $ n, -1, -1, -1, imat, nfail, nerrs,
283 $ nout )
284 GO TO 120
285 END IF
286
287
288
289 DO 110 inb = 1, nnb
290 nb = nbval( inb )
292
293
294
295
296 CALL slacpy( uplo, n, n, a, lda, afac, lda )
297 srnamt = 'SPSTRF'
298
299
300
301 tol = -one
302 CALL spstrf( uplo, n, afac, lda, piv, comprank,
303 $ tol, work, info )
304
305
306
307 IF( (info.LT.izero)
308 $ .OR.(info.NE.izero.AND.rank.EQ.n)
309 $ .OR.(info.LE.izero.AND.rank.LT.n) ) THEN
310 CALL alaerh( path,
'SPSTRF', info, izero,
311 $ uplo, n, n, -1, -1, nb, imat,
312 $ nfail, nerrs, nout )
313 GO TO 110
314 END IF
315
316
317
318 IF( info.NE.0 )
319 $ GO TO 110
320
321
322
323
324
325 CALL spst01( uplo, n, a, lda, afac, lda, perm, lda,
326 $ piv, rwork, result, comprank )
327
328
329
330
331 IF( n.EQ.0 )
332 $ comprank = 0
333 rankdiff = rank - comprank
334 IF( result.GE.thresh ) THEN
335 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
336 $
CALL alahd( nout, path )
337 WRITE( nout, fmt = 9999 )uplo, n, rank,
338 $ rankdiff, nb, imat, result
339 nfail = nfail + 1
340 END IF
341 nrun = nrun + 1
342 110 CONTINUE
343
344 120 CONTINUE
345 130 CONTINUE
346 140 CONTINUE
347 150 CONTINUE
348
349
350
351 CALL alasum( path, nout, nfail, nrun, nerrs )
352
353 9999 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ', RANK =', i3,
354 $ ', Diff =', i5, ', NB =', i4, ', type ', i2, ', Ratio =',
355 $ g12.5 )
356 RETURN
357
358
359
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine xlaenv(ispec, nvalue)
XLAENV
subroutine alaerh(path, subnam, info, infoe, opts, m, n, kl, ku, n5, imat, nfail, nerrs, nout)
ALAERH
subroutine alahd(iounit, path)
ALAHD
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine spstrf(uplo, n, a, lda, piv, rank, tol, work, info)
SPSTRF computes the Cholesky factorization with complete pivoting of a real symmetric positive semide...
subroutine serrps(path, nunit)
SERRPS
subroutine slatb5(path, imat, n, type, kl, ku, anorm, mode, cndnum, dist)
SLATB5
subroutine slatmt(m, n, dist, iseed, sym, d, mode, cond, dmax, rank, kl, ku, pack, a, lda, work, info)
SLATMT
subroutine spst01(uplo, n, a, lda, afac, ldafac, perm, ldperm, piv, rwork, resid, rank)
SPST01