158 SUBROUTINE cdrvpo( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
159 $ a, afac, asav, b, bsav, x, xact, s, work,
169 INTEGER nmax, nn, nout, nrhs
175 REAL rwork( * ), s( * )
176 COMPLEX a( * ), afac( * ), asav( * ), b( * ),
177 $ bsav( * ), work( * ), x( * ), xact( * )
184 parameter( one = 1.0e+0, zero = 0.0e+0 )
186 parameter( ntypes = 9 )
188 parameter( ntests = 6 )
191 LOGICAL equil, nofact, prefac, zerot
192 CHARACTER dist, equed, fact, type, uplo, xtype
194 INTEGER i, iequed, ifact, imat, in, info, ioff, iuplo,
195 $ izero, k, k1, kl, ku, lda, mode, n, nb, nbmin,
196 $ nerrs, nfact, nfail, nimat, nrun, nt
197 REAL ainvnm, amax, anorm, cndnum, rcond, rcondc,
201 CHARACTER equeds( 2 ), facts( 3 ), uplos( 2 )
202 INTEGER iseed( 4 ), iseedy( 4 )
203 REAL result( ntests )
222 common / infoc / infot, nunit, ok, lerr
223 common / srnamc / srnamt
229 DATA iseedy / 1988, 1989, 1990, 1991 /
230 DATA uplos /
'U',
'L' /
231 DATA facts /
'F',
'N',
'E' /
232 DATA equeds /
'N',
'Y' /
238 path( 1: 1 ) =
'Complex precision'
244 iseed( i ) = iseedy( i )
250 $ CALL
cerrvx( path, nout )
270 DO 120 imat = 1, nimat
274 IF( .NOT.dotype( imat ) )
279 zerot = imat.GE.3 .AND. imat.LE.5
280 IF( zerot .AND. n.LT.imat-2 )
286 uplo = uplos( iuplo )
291 CALL
clatb4( path, imat, n, n, type, kl, ku, anorm, mode,
295 CALL
clatms( n, n, dist, iseed, type, rwork, mode,
296 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
302 CALL
alaerh( path,
'CLATMS', info, 0, uplo, n, n, -1,
303 $ -1, -1, imat, nfail, nerrs, nout )
313 ELSE IF( imat.EQ.4 )
THEN
318 ioff = ( izero-1 )*lda
322 IF( iuplo.EQ.1 )
THEN
323 DO 20 i = 1, izero - 1
333 DO 40 i = 1, izero - 1
348 CALL
claipd( n, a, lda+1, 0 )
352 CALL
clacpy( uplo, n, n, a, lda, asav, lda )
355 equed = equeds( iequed )
356 IF( iequed.EQ.1 )
THEN
362 DO 90 ifact = 1, nfact
363 fact = facts( ifact )
364 prefac =
lsame( fact,
'F' )
365 nofact =
lsame( fact,
'N' )
366 equil =
lsame( fact,
'E' )
373 ELSE IF( .NOT.
lsame( fact,
'N' ) )
THEN
380 CALL
clacpy( uplo, n, n, asav, lda, afac, lda )
381 IF( equil .OR. iequed.GT.1 )
THEN
386 CALL
cpoequ( n, afac, lda, s, scond, amax,
388 IF( info.EQ.0 .AND. n.GT.0 )
THEN
394 CALL
claqhe( uplo, n, afac, lda, s, scond,
407 anorm =
clanhe(
'1', uplo, n, afac, lda, rwork )
411 CALL
cpotrf( uplo, n, afac, lda, info )
415 CALL
clacpy( uplo, n, n, afac, lda, a, lda )
416 CALL
cpotri( uplo, n, a, lda, info )
420 ainvnm =
clanhe(
'1', uplo, n, a, lda, rwork )
421 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
424 rcondc = ( one / anorm ) / ainvnm
430 CALL
clacpy( uplo, n, n, asav, lda, a, lda )
435 CALL
clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
436 $ nrhs, a, lda, xact, lda, b, lda,
439 CALL
clacpy(
'Full', n, nrhs, b, lda, bsav, lda )
448 CALL
clacpy( uplo, n, n, a, lda, afac, lda )
449 CALL
clacpy(
'Full', n, nrhs, b, lda, x, lda )
452 CALL
cposv( uplo, n, nrhs, afac, lda, x, lda,
457 IF( info.NE.izero )
THEN
458 CALL
alaerh( path,
'CPOSV ', info, izero,
459 $ uplo, n, n, -1, -1, nrhs, imat,
460 $ nfail, nerrs, nout )
462 ELSE IF( info.NE.0 )
THEN
469 CALL
cpot01( uplo, n, a, lda, afac, lda, rwork,
474 CALL
clacpy(
'Full', n, nrhs, b, lda, work,
476 CALL
cpot02( uplo, n, nrhs, a, lda, x, lda,
477 $ work, lda, rwork, result( 2 ) )
481 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
489 IF( result( k ).GE.thresh )
THEN
490 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
491 $ CALL
aladhd( nout, path )
492 WRITE( nout, fmt = 9999 )
'CPOSV ', uplo,
493 $ n, imat, k, result( k )
504 $ CALL
claset( uplo, n, n, cmplx( zero ),
505 $ cmplx( zero ), afac, lda )
506 CALL
claset(
'Full', n, nrhs, cmplx( zero ),
507 $ cmplx( zero ), x, lda )
508 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
513 CALL
claqhe( uplo, n, a, lda, s, scond, amax,
521 CALL
cposvx( fact, uplo, n, nrhs, a, lda, afac,
522 $ lda, equed, s, b, lda, x, lda, rcond,
523 $ rwork, rwork( nrhs+1 ), work,
524 $ rwork( 2*nrhs+1 ), info )
528 IF( info.NE.izero )
THEN
529 CALL
alaerh( path,
'CPOSVX', info, izero,
530 $ fact // uplo, n, n, -1, -1, nrhs,
531 $ imat, nfail, nerrs, nout )
536 IF( .NOT.prefac )
THEN
541 CALL
cpot01( uplo, n, a, lda, afac, lda,
542 $ rwork( 2*nrhs+1 ), result( 1 ) )
550 CALL
clacpy(
'Full', n, nrhs, bsav, lda, work,
552 CALL
cpot02( uplo, n, nrhs, asav, lda, x, lda,
553 $ work, lda, rwork( 2*nrhs+1 ),
558 IF( nofact .OR. ( prefac .AND.
lsame( equed,
560 CALL
cget04( n, nrhs, x, lda, xact, lda,
561 $ rcondc, result( 3 ) )
563 CALL
cget04( n, nrhs, x, lda, xact, lda,
564 $ roldc, result( 3 ) )
570 CALL
cpot05( uplo, n, nrhs, asav, lda, b, lda,
571 $ x, lda, xact, lda, rwork,
572 $ rwork( nrhs+1 ), result( 4 ) )
580 result( 6 ) =
sget06( rcond, rcondc )
586 IF( result( k ).GE.thresh )
THEN
587 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
588 $ CALL
aladhd( nout, path )
590 WRITE( nout, fmt = 9997 )
'CPOSVX', fact,
591 $ uplo, n, equed, imat, k, result( k )
593 WRITE( nout, fmt = 9998 )
'CPOSVX', fact,
594 $ uplo, n, imat, k, result( k )
608 CALL
alasvm( path, nout, nfail, nrun, nerrs )
610 9999 format( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i1,
611 $
', test(', i1,
')=', g12.5 )
612 9998 format( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N=', i5,
613 $
', type ', i1,
', test(', i1,
')=', g12.5 )
614 9997 format( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N=', i5,
615 $
', EQUED=''', a1,
''', type ', i1,
', test(', i1,
') =',