172 SUBROUTINE cchkhe( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
173 $ thresh, tsterr, nmax, a, afac, ainv, b, x,
174 $ xact, work, rwork, iwork, nout )
183 INTEGER nmax, nn, nnb, nns, nout
188 INTEGER iwork( * ), nbval( * ), nsval( * ), nval( * )
190 COMPLEX a( * ), afac( * ), ainv( * ), b( * ),
191 $ work( * ), x( * ), xact( * )
198 parameter( zero = 0.0e+0 )
200 parameter( ntypes = 10 )
202 parameter( ntests = 9 )
205 LOGICAL trfcon, zerot
206 CHARACTER dist, type, uplo, xtype
208 INTEGER i, i1, i2, imat, in, inb, info, ioff, irhs,
209 $ iuplo, izero, j, k, kl, ku, lda, lwork, mode,
210 $ n, nb, nerrs, nfail, nimat, nrhs, nrun, nt
211 REAL anorm, cndnum, rcond, rcondc
215 INTEGER iseed( 4 ), iseedy( 4 )
216 REAL result( ntests )
237 common / infoc / infot, nunit, ok, lerr
238 common / srnamc / srnamt
241 DATA iseedy / 1988, 1989, 1990, 1991 /
242 DATA uplos /
'U',
'L' /
248 path( 1: 1 ) =
'Complex precision'
254 iseed( i ) = iseedy( i )
260 $ CALL
cerrhe( path, nout )
274 DO 170 imat = 1, nimat
278 IF( .NOT.dotype( imat ) )
283 zerot = imat.GE.3 .AND. imat.LE.6
284 IF( zerot .AND. n.LT.imat-2 )
290 uplo = uplos( iuplo )
295 CALL
clatb4( path, imat, n, n, type, kl, ku, anorm, mode,
299 CALL
clatms( n, n, dist, iseed, type, rwork, mode,
300 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
306 CALL
alaerh( path,
'CLATMS', info, 0, uplo, n, n, -1,
307 $ -1, -1, imat, nfail, nerrs, nout )
317 ELSE IF( imat.EQ.4 )
THEN
327 IF( iuplo.EQ.1 )
THEN
328 ioff = ( izero-1 )*lda
329 DO 20 i = 1, izero - 1
339 DO 40 i = 1, izero - 1
350 IF( iuplo.EQ.1 )
THEN
380 CALL
claipd( n, a, lda+1, 0 )
391 CALL
clacpy( uplo, n, n, a, lda, afac, lda )
392 lwork = max( 2, nb )*lda
394 CALL
chetrf( uplo, n, afac, lda, iwork, ainv, lwork,
403 IF( iwork( k ).LT.0 )
THEN
404 IF( iwork( k ).NE.-k )
THEN
408 ELSE IF( iwork( k ).NE.k )
THEN
417 $ CALL
alaerh( path,
'CHETRF', info, k, uplo, n, n,
418 $ -1, -1, nb, imat, nfail, nerrs, nout )
428 CALL
chet01( uplo, n, a, lda, afac, lda, iwork, ainv,
429 $ lda, rwork, result( 1 ) )
435 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
436 CALL
clacpy( uplo, n, n, afac, lda, ainv, lda )
438 lwork = (n+nb+1)*(nb+3)
439 CALL
chetri2( uplo, n, ainv, lda, iwork, work,
445 $ CALL
alaerh( path,
'CHETRI', info, -1, uplo, n,
446 $ n, -1, -1, -1, imat, nfail, nerrs,
449 CALL
cpot03( uplo, n, a, lda, ainv, lda, work, lda,
450 $ rwork, rcondc, result( 2 ) )
458 IF( result( k ).GE.thresh )
THEN
459 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
460 $ CALL
alahd( nout, path )
461 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
488 CALL
clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
489 $ nrhs, a, lda, xact, lda, b, lda,
491 CALL
clacpy(
'Full', n, nrhs, b, lda, x, lda )
494 CALL
chetrs( uplo, n, nrhs, afac, lda, iwork, x,
500 $ CALL
alaerh( path,
'CHETRS', info, 0, uplo, n,
501 $ n, -1, -1, nrhs, imat, nfail,
504 CALL
clacpy(
'Full', n, nrhs, b, lda, work, lda )
505 CALL
cpot02( uplo, n, nrhs, a, lda, x, lda, work,
506 $ lda, rwork, result( 3 ) )
512 CALL
clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
513 $ nrhs, a, lda, xact, lda, b, lda,
515 CALL
clacpy(
'Full', n, nrhs, b, lda, x, lda )
518 CALL
chetrs2( uplo, n, nrhs, afac, lda, iwork, x,
524 $ CALL
alaerh( path,
'CHETRS2', info, 0, uplo, n,
525 $ n, -1, -1, nrhs, imat, nfail,
528 CALL
clacpy(
'Full', n, nrhs, b, lda, work, lda )
529 CALL
cpot02( uplo, n, nrhs, a, lda, x, lda, work,
530 $ lda, rwork, result( 4 ) )
535 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
542 CALL
cherfs( uplo, n, nrhs, a, lda, afac, lda,
543 $ iwork, b, lda, x, lda, rwork,
544 $ rwork( nrhs+1 ), work,
545 $ rwork( 2*nrhs+1 ), info )
550 $ CALL
alaerh( path,
'CHERFS', info, 0, uplo, n,
551 $ n, -1, -1, nrhs, imat, nfail,
554 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
556 CALL
cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
557 $ xact, lda, rwork, rwork( nrhs+1 ),
564 IF( result( k ).GE.thresh )
THEN
565 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
566 $ CALL
alahd( nout, path )
567 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
568 $ imat, k, result( k )
579 anorm =
clanhe(
'1', uplo, n, a, lda, rwork )
581 CALL
checon( uplo, n, afac, lda, iwork, anorm, rcond,
587 $ CALL
alaerh( path,
'CHECON', info, 0, uplo, n, n,
588 $ -1, -1, -1, imat, nfail, nerrs, nout )
590 result( 9 ) =
sget06( rcond, rcondc )
595 IF( result( 9 ).GE.thresh )
THEN
596 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
597 $ CALL
alahd( nout, path )
598 WRITE( nout, fmt = 9997 )uplo, n, imat, 8,
610 CALL
alasum( path, nout, nfail, nrun, nerrs )
612 9999 format(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
613 $ i2,
', test ', i2,
', ratio =', g12.5 )
614 9998 format(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
615 $ i2,
', test(', i2,
') =', g12.5 )
616 9997 format(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
617 $
', test(', i2,
') =', g12.5 )