168
169
170
171
172
173
174 LOGICAL TSTERR
175 INTEGER NMAX, NN, NNB, NNS, NOUT
176 REAL THRESH
177
178
179 LOGICAL DOTYPE( * )
180 INTEGER NBVAL( * ), NSVAL( * ), NVAL( * )
181 REAL RWORK( * )
182 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
183 $ WORK( * ), X( * ), XACT( * )
184
185
186
187
188
189 COMPLEX CZERO
190 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
191 INTEGER NTYPES
192 parameter( ntypes = 9 )
193 INTEGER NTESTS
194 parameter( ntests = 8 )
195
196
197 LOGICAL ZEROT
198 CHARACTER DIST, TYPE, UPLO, XTYPE
199 CHARACTER*3 PATH
200 INTEGER I, IMAT, IN, INB, INFO, IOFF, IRHS, IUPLO,
201 $ IZERO, K, KL, KU, LDA, MODE, N, NB, NERRS,
202 $ NFAIL, NIMAT, NRHS, NRUN
203 REAL ANORM, CNDNUM, RCOND, RCONDC
204
205
206 CHARACTER UPLOS( 2 )
207 INTEGER ISEED( 4 ), ISEEDY( 4 )
208 REAL RESULT( NTESTS )
209
210
211 REAL CLANHE, SGET06
213
214
219
220
221 LOGICAL LERR, OK
222 CHARACTER*32 SRNAMT
223 INTEGER INFOT, NUNIT
224
225
226 COMMON / infoc / infot, nunit, ok, lerr
227 COMMON / srnamc / srnamt
228
229
230 INTRINSIC max
231
232
233 DATA iseedy / 1988, 1989, 1990, 1991 /
234 DATA uplos / 'U', 'L' /
235
236
237
238
239
240 path( 1: 1 ) = 'Complex precision'
241 path( 2: 3 ) = 'PO'
242 nrun = 0
243 nfail = 0
244 nerrs = 0
245 DO 10 i = 1, 4
246 iseed( i ) = iseedy( i )
247 10 CONTINUE
248
249
250
251 IF( tsterr )
252 $
CALL cerrpo( path, nout )
253 infot = 0
254
255
256
257 DO 120 in = 1, nn
258 n = nval( in )
259 lda = max( n, 1 )
260 xtype = 'N'
261 nimat = ntypes
262 IF( n.LE.0 )
263 $ nimat = 1
264
265 izero = 0
266 DO 110 imat = 1, nimat
267
268
269
270 IF( .NOT.dotype( imat ) )
271 $ GO TO 110
272
273
274
275 zerot = imat.GE.3 .AND. imat.LE.5
276 IF( zerot .AND. n.LT.imat-2 )
277 $ GO TO 110
278
279
280
281 DO 100 iuplo = 1, 2
282 uplo = uplos( iuplo )
283
284
285
286
287 CALL clatb4( path, imat, n, n,
TYPE, KL, KU, ANORM, MODE,
288 $ CNDNUM, DIST )
289
290 srnamt = 'CLATMS'
291 CALL clatms( n, n, dist, iseed,
TYPE, RWORK, MODE,
292 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA, WORK,
293 $ INFO )
294
295
296
297 IF( info.NE.0 ) THEN
298 CALL alaerh( path,
'CLATMS', info, 0, uplo, n, n, -1,
299 $ -1, -1, imat, nfail, nerrs, nout )
300 GO TO 100
301 END IF
302
303
304
305
306 IF( zerot ) THEN
307 IF( imat.EQ.3 ) THEN
308 izero = 1
309 ELSE IF( imat.EQ.4 ) THEN
310 izero = n
311 ELSE
312 izero = n / 2 + 1
313 END IF
314 ioff = ( izero-1 )*lda
315
316
317
318 IF( iuplo.EQ.1 ) THEN
319 DO 20 i = 1, izero - 1
320 a( ioff+i ) = czero
321 20 CONTINUE
322 ioff = ioff + izero
323 DO 30 i = izero, n
324 a( ioff ) = czero
325 ioff = ioff + lda
326 30 CONTINUE
327 ELSE
328 ioff = izero
329 DO 40 i = 1, izero - 1
330 a( ioff ) = czero
331 ioff = ioff + lda
332 40 CONTINUE
333 ioff = ioff - izero
334 DO 50 i = izero, n
335 a( ioff+i ) = czero
336 50 CONTINUE
337 END IF
338 ELSE
339 izero = 0
340 END IF
341
342
343
344 CALL claipd( n, a, lda+1, 0 )
345
346
347
348 DO 90 inb = 1, nnb
349 nb = nbval( inb )
351
352
353
354 CALL clacpy( uplo, n, n, a, lda, afac, lda )
355 srnamt = 'CPOTRF'
356 CALL cpotrf( uplo, n, afac, lda, info )
357
358
359
360 IF( info.NE.izero ) THEN
361 CALL alaerh( path,
'CPOTRF', info, izero, uplo, n,
362 $ n, -1, -1, nb, imat, nfail, nerrs,
363 $ nout )
364 GO TO 90
365 END IF
366
367
368
369 IF( info.NE.0 )
370 $ GO TO 90
371
372
373
374
375 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
376 CALL cpot01( uplo, n, a, lda, ainv, lda, rwork,
377 $ result( 1 ) )
378
379
380
381
382 CALL clacpy( uplo, n, n, afac, lda, ainv, lda )
383 srnamt = 'CPOTRI'
384 CALL cpotri( uplo, n, ainv, lda, info )
385
386
387
388 IF( info.NE.0 )
389 $
CALL alaerh( path,
'CPOTRI', info, 0, uplo, n, n,
390 $ -1, -1, -1, imat, nfail, nerrs, nout )
391
392 CALL cpot03( uplo, n, a, lda, ainv, lda, work, lda,
393 $ rwork, rcondc, result( 2 ) )
394
395
396
397
398 DO 60 k = 1, 2
399 IF( result( k ).GE.thresh ) THEN
400 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
401 $
CALL alahd( nout, path )
402 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
403 $ result( k )
404 nfail = nfail + 1
405 END IF
406 60 CONTINUE
407 nrun = nrun + 2
408
409
410
411
412 IF( inb.NE.1 )
413 $ GO TO 90
414
415 DO 80 irhs = 1, nns
416 nrhs = nsval( irhs )
417
418
419
420
421 srnamt = 'CLARHS'
422 CALL clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
423 $ nrhs, a, lda, xact, lda, b, lda,
424 $ iseed, info )
425 CALL clacpy(
'Full', n, nrhs, b, lda, x, lda )
426
427 srnamt = 'CPOTRS'
428 CALL cpotrs( uplo, n, nrhs, afac, lda, x, lda,
429 $ info )
430
431
432
433 IF( info.NE.0 )
434 $
CALL alaerh( path,
'CPOTRS', info, 0, uplo, n,
435 $ n, -1, -1, nrhs, imat, nfail,
436 $ nerrs, nout )
437
438 CALL clacpy(
'Full', n, nrhs, b, lda, work, lda )
439 CALL cpot02( uplo, n, nrhs, a, lda, x, lda, work,
440 $ lda, rwork, result( 3 ) )
441
442
443
444
445 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
446 $ result( 4 ) )
447
448
449
450
451 srnamt = 'CPORFS'
452 CALL cporfs( uplo, n, nrhs, a, lda, afac, lda, b,
453 $ lda, x, lda, rwork, rwork( nrhs+1 ),
454 $ work, rwork( 2*nrhs+1 ), info )
455
456
457
458 IF( info.NE.0 )
459 $
CALL alaerh( path,
'CPORFS', info, 0, uplo, n,
460 $ n, -1, -1, nrhs, imat, nfail,
461 $ nerrs, nout )
462
463 CALL cget04( n, nrhs, x, lda, xact, lda, rcondc,
464 $ result( 5 ) )
465 CALL cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
466 $ xact, lda, rwork, rwork( nrhs+1 ),
467 $ result( 6 ) )
468
469
470
471
472 DO 70 k = 3, 7
473 IF( result( k ).GE.thresh ) THEN
474 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
475 $
CALL alahd( nout, path )
476 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
477 $ imat, k, result( k )
478 nfail = nfail + 1
479 END IF
480 70 CONTINUE
481 nrun = nrun + 5
482 80 CONTINUE
483
484
485
486
487 anorm =
clanhe(
'1', uplo, n, a, lda, rwork )
488 srnamt = 'CPOCON'
489 CALL cpocon( uplo, n, afac, lda, anorm, rcond, work,
490 $ rwork, info )
491
492
493
494 IF( info.NE.0 )
495 $
CALL alaerh( path,
'CPOCON', info, 0, uplo, n, n,
496 $ -1, -1, -1, imat, nfail, nerrs, nout )
497
498 result( 8 ) =
sget06( rcond, rcondc )
499
500
501
502 IF( result( 8 ).GE.thresh ) THEN
503 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
504 $
CALL alahd( nout, path )
505 WRITE( nout, fmt = 9997 )uplo, n, imat, 8,
506 $ result( 8 )
507 nfail = nfail + 1
508 END IF
509 nrun = nrun + 1
510 90 CONTINUE
511 100 CONTINUE
512 110 CONTINUE
513 120 CONTINUE
514
515
516
517 CALL alasum( path, nout, nfail, nrun, nerrs )
518
519 9999 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ', NB =', i4, ', type ',
520 $ i2, ', test ', i2, ', ratio =', g12.5 )
521 9998 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ', NRHS=', i3, ', type ',
522 $ i2, ', test(', i2, ') =', g12.5 )
523 9997 FORMAT( ' UPLO = ''', a1, ''', N =', i5, ',', 10x, ' type ', i2,
524 $ ', test(', i2, ') =', g12.5 )
525 RETURN
526
527
528
subroutine alasum(type, nout, nfail, nrun, nerrs)
ALASUM
subroutine clarhs(path, xtype, uplo, trans, m, n, kl, ku, nrhs, a, lda, x, ldx, b, ldb, iseed, info)
CLARHS
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 cerrpo(path, nunit)
CERRPO
subroutine cget04(n, nrhs, x, ldx, xact, ldxact, rcond, resid)
CGET04
subroutine claipd(n, a, inda, vinda)
CLAIPD
subroutine clatb4(path, imat, m, n, type, kl, ku, anorm, mode, cndnum, dist)
CLATB4
subroutine clatms(m, n, dist, iseed, sym, d, mode, cond, dmax, kl, ku, pack, a, lda, work, info)
CLATMS
subroutine cpot01(uplo, n, a, lda, afac, ldafac, rwork, resid)
CPOT01
subroutine cpot02(uplo, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
CPOT02
subroutine cpot03(uplo, n, a, lda, ainv, ldainv, work, ldwork, rwork, rcond, resid)
CPOT03
subroutine cpot05(uplo, n, nrhs, a, lda, b, ldb, x, ldx, xact, ldxact, ferr, berr, reslts)
CPOT05
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
real function clanhe(norm, uplo, n, a, lda, work)
CLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm,...
subroutine cpocon(uplo, n, a, lda, anorm, rcond, work, rwork, info)
CPOCON
subroutine cporfs(uplo, n, nrhs, a, lda, af, ldaf, b, ldb, x, ldx, ferr, berr, work, rwork, info)
CPORFS
subroutine cpotrf(uplo, n, a, lda, info)
CPOTRF
subroutine cpotri(uplo, n, a, lda, info)
CPOTRI
subroutine cpotrs(uplo, n, nrhs, a, lda, b, ldb, info)
CPOTRS
real function sget06(rcond, rcondc)
SGET06