153 SUBROUTINE cdrvhe( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
154 $ a, afac, ainv, b, x, xact, work, rwork, iwork,
164 INTEGER nmax, nn, nout, nrhs
169 INTEGER iwork( * ), nval( * )
171 COMPLEX a( * ), afac( * ), ainv( * ), b( * ),
172 $ work( * ), x( * ), xact( * )
179 parameter( one = 1.0e+0, zero = 0.0e+0 )
180 INTEGER ntypes, ntests
181 parameter( ntypes = 10, ntests = 6 )
183 parameter( nfact = 2 )
187 CHARACTER dist, fact, type, uplo, xtype
189 INTEGER i, i1, i2, ifact, imat, in, info, ioff, iuplo,
190 $ izero, j, k, k1, kl, ku, lda, lwork, mode, n,
191 $ nb, nbmin, nerrs, nfail, nimat, nrun, nt
192 REAL ainvnm, anorm, cndnum, rcond, rcondc
195 CHARACTER facts( nfact ), uplos( 2 )
196 INTEGER iseed( 4 ), iseedy( 4 )
197 REAL result( ntests )
215 common / infoc / infot, nunit, ok, lerr
216 common / srnamc / srnamt
219 INTRINSIC cmplx, max, min
222 DATA iseedy / 1988, 1989, 1990, 1991 /
223 DATA uplos /
'U',
'L' / , facts /
'F',
'N' /
235 iseed( i ) = iseedy( i )
237 lwork = max( 2*nmax, nmax*nrhs )
242 $ CALL
cerrvx( path, nout )
262 DO 170 imat = 1, nimat
266 IF( .NOT.dotype( imat ) )
271 zerot = imat.GE.3 .AND. imat.LE.6
272 IF( zerot .AND. n.LT.imat-2 )
278 uplo = uplos( iuplo )
283 CALL
clatb4( path, imat, n, n, type, kl, ku, anorm, mode,
287 CALL
clatms( n, n, dist, iseed, type, rwork, mode,
288 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
294 CALL
alaerh( path,
'CLATMS', info, 0, uplo, n, n, -1,
295 $ -1, -1, imat, nfail, nerrs, nout )
305 ELSE IF( imat.EQ.4 )
THEN
315 IF( iuplo.EQ.1 )
THEN
316 ioff = ( izero-1 )*lda
317 DO 20 i = 1, izero - 1
327 DO 40 i = 1, izero - 1
338 IF( iuplo.EQ.1 )
THEN
368 CALL
claipd( n, a, lda+1, 0 )
370 DO 150 ifact = 1, nfact
374 fact = facts( ifact )
384 ELSE IF( ifact.EQ.1 )
THEN
388 anorm =
clanhe(
'1', uplo, n, a, lda, rwork )
392 CALL
clacpy( uplo, n, n, a, lda, afac, lda )
393 CALL
chetrf( uplo, n, afac, lda, iwork, work,
398 CALL
clacpy( uplo, n, n, afac, lda, ainv, lda )
399 lwork = (n+nb+1)*(nb+3)
400 CALL
chetri2( uplo, n, ainv, lda, iwork, work,
402 ainvnm =
clanhe(
'1', uplo, n, ainv, lda, rwork )
406 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
409 rcondc = ( one / anorm ) / ainvnm
416 CALL
clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
417 $ nrhs, a, lda, xact, lda, b, lda, iseed,
423 IF( ifact.EQ.2 )
THEN
424 CALL
clacpy( uplo, n, n, a, lda, afac, lda )
425 CALL
clacpy(
'Full', n, nrhs, b, lda, x, lda )
430 CALL
chesv( uplo, n, nrhs, afac, lda, iwork, x,
431 $ lda, work, lwork, info )
439 IF( iwork( k ).LT.0 )
THEN
440 IF( iwork( k ).NE.-k )
THEN
444 ELSE IF( iwork( k ).NE.k )
THEN
453 CALL
alaerh( path,
'CHESV ', info, k, uplo, n,
454 $ n, -1, -1, nrhs, imat, nfail,
457 ELSE IF( info.NE.0 )
THEN
464 CALL
chet01( uplo, n, a, lda, afac, lda, iwork,
465 $ ainv, lda, rwork, result( 1 ) )
469 CALL
clacpy(
'Full', n, nrhs, b, lda, work, lda )
470 CALL
cpot02( uplo, n, nrhs, a, lda, x, lda, work,
471 $ lda, rwork, result( 2 ) )
475 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
483 IF( result( k ).GE.thresh )
THEN
484 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
485 $ CALL
aladhd( nout, path )
486 WRITE( nout, fmt = 9999 )
'CHESV ', uplo, n,
487 $ imat, k, result( k )
498 $ CALL
claset( uplo, n, n, cmplx( zero ),
499 $ cmplx( zero ), afac, lda )
500 CALL
claset(
'Full', n, nrhs, cmplx( zero ),
501 $ cmplx( zero ), x, lda )
507 CALL
chesvx( fact, uplo, n, nrhs, a, lda, afac, lda,
508 $ iwork, b, lda, x, lda, rcond, rwork,
509 $ rwork( nrhs+1 ), work, lwork,
510 $ rwork( 2*nrhs+1 ), info )
518 IF( iwork( k ).LT.0 )
THEN
519 IF( iwork( k ).NE.-k )
THEN
523 ELSE IF( iwork( k ).NE.k )
THEN
532 CALL
alaerh( path,
'CHESVX', info, k, fact // uplo,
533 $ n, n, -1, -1, nrhs, imat, nfail,
539 IF( ifact.GE.2 )
THEN
544 CALL
chet01( uplo, n, a, lda, afac, lda, iwork,
545 $ ainv, lda, rwork( 2*nrhs+1 ),
554 CALL
clacpy(
'Full', n, nrhs, b, lda, work, lda )
555 CALL
cpot02( uplo, n, nrhs, a, lda, x, lda, work,
556 $ lda, rwork( 2*nrhs+1 ), result( 2 ) )
560 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
565 CALL
cpot05( uplo, n, nrhs, a, lda, b, lda, x, lda,
566 $ xact, lda, rwork, rwork( nrhs+1 ),
575 result( 6 ) =
sget06( rcond, rcondc )
581 IF( result( k ).GE.thresh )
THEN
582 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
583 $ CALL
aladhd( nout, path )
584 WRITE( nout, fmt = 9998 )
'CHESVX', fact, uplo,
585 $ n, imat, k, result( k )
599 CALL
alasvm( path, nout, nfail, nrun, nerrs )
601 9999 format( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i2,
602 $
', test ', i2,
', ratio =', g12.5 )
603 9998 format( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N =', i5,
604 $
', type ', i2,
', test ', i2,
', ratio =', g12.5 )