161 SUBROUTINE cdrvpo( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
162 $ a, afac, asav, b, bsav, x, xact, s, work,
172 INTEGER nmax, nn, nout, nrhs
178 REAL rwork( * ), s( * )
179 COMPLEX a( * ), afac( * ), asav( * ), b( * ),
180 $ bsav( * ), work( * ), x( * ), xact( * )
187 parameter( one = 1.0e+0, zero = 0.0e+0 )
189 parameter( ntypes = 9 )
191 parameter( ntests = 6 )
194 LOGICAL equil, nofact, prefac, zerot
195 CHARACTER dist, equed, fact, type, uplo, xtype
197 INTEGER i, iequed, ifact, imat, in, info, ioff, iuplo,
198 $ izero, k, k1, kl, ku, lda, mode, n, nb, nbmin,
199 $ nerrs, nfact, nfail, nimat, nrun, nt,
201 REAL ainvnm, amax, anorm, cndnum, rcond, rcondc,
202 $ roldc, scond, rpvgrw_svxx
205 CHARACTER equeds( 2 ), facts( 3 ), uplos( 2 )
206 INTEGER iseed( 4 ), iseedy( 4 )
207 REAL result( ntests ), berr( nrhs ),
208 $ errbnds_n( nrhs, 3 ), errbnds_c( nrhs, 3 )
227 common / infoc / infot, nunit, ok, lerr
228 common / srnamc / srnamt
234 DATA iseedy / 1988, 1989, 1990, 1991 /
235 DATA uplos /
'U',
'L' /
236 DATA facts /
'F',
'N',
'E' /
237 DATA equeds /
'N',
'Y' /
243 path( 1: 1 ) =
'Complex precision'
249 iseed( i ) = iseedy( i )
255 $ CALL
cerrvx( path, nout )
275 DO 120 imat = 1, nimat
279 IF( .NOT.dotype( imat ) )
284 zerot = imat.GE.3 .AND. imat.LE.5
285 IF( zerot .AND. n.LT.imat-2 )
291 uplo = uplos( iuplo )
296 CALL
clatb4( path, imat, n, n, type, kl, ku, anorm, mode,
300 CALL
clatms( n, n, dist, iseed, type, rwork, mode,
301 $ cndnum, anorm, kl, ku, uplo, a, lda, work,
307 CALL
alaerh( path,
'CLATMS', info, 0, uplo, n, n, -1,
308 $ -1, -1, imat, nfail, nerrs, nout )
318 ELSE IF( imat.EQ.4 )
THEN
323 ioff = ( izero-1 )*lda
327 IF( iuplo.EQ.1 )
THEN
328 DO 20 i = 1, izero - 1
338 DO 40 i = 1, izero - 1
353 CALL
claipd( n, a, lda+1, 0 )
357 CALL
clacpy( uplo, n, n, a, lda, asav, lda )
360 equed = equeds( iequed )
361 IF( iequed.EQ.1 )
THEN
367 DO 90 ifact = 1, nfact
368 fact = facts( ifact )
369 prefac =
lsame( fact,
'F' )
370 nofact =
lsame( fact,
'N' )
371 equil =
lsame( fact,
'E' )
378 ELSE IF( .NOT.
lsame( fact,
'N' ) )
THEN
385 CALL
clacpy( uplo, n, n, asav, lda, afac, lda )
386 IF( equil .OR. iequed.GT.1 )
THEN
391 CALL
cpoequ( n, afac, lda, s, scond, amax,
393 IF( info.EQ.0 .AND. n.GT.0 )
THEN
399 CALL
claqhe( uplo, n, afac, lda, s, scond,
412 anorm =
clanhe(
'1', uplo, n, afac, lda, rwork )
416 CALL
cpotrf( uplo, n, afac, lda, info )
420 CALL
clacpy( uplo, n, n, afac, lda, a, lda )
421 CALL
cpotri( uplo, n, a, lda, info )
425 ainvnm =
clanhe(
'1', uplo, n, a, lda, rwork )
426 IF( anorm.LE.zero .OR. ainvnm.LE.zero )
THEN
429 rcondc = ( one / anorm ) / ainvnm
435 CALL
clacpy( uplo, n, n, asav, lda, a, lda )
440 CALL
clarhs( path, xtype, uplo,
' ', n, n, kl, ku,
441 $ nrhs, a, lda, xact, lda, b, lda,
444 CALL
clacpy(
'Full', n, nrhs, b, lda, bsav, lda )
453 CALL
clacpy( uplo, n, n, a, lda, afac, lda )
454 CALL
clacpy(
'Full', n, nrhs, b, lda, x, lda )
457 CALL
cposv( uplo, n, nrhs, afac, lda, x, lda,
462 IF( info.NE.izero )
THEN
463 CALL
alaerh( path,
'CPOSV ', info, izero,
464 $ uplo, n, n, -1, -1, nrhs, imat,
465 $ nfail, nerrs, nout )
467 ELSE IF( info.NE.0 )
THEN
474 CALL
cpot01( uplo, n, a, lda, afac, lda, rwork,
479 CALL
clacpy(
'Full', n, nrhs, b, lda, work,
481 CALL
cpot02( uplo, n, nrhs, a, lda, x, lda,
482 $ work, lda, rwork, result( 2 ) )
486 CALL
cget04( n, nrhs, x, lda, xact, lda, rcondc,
494 IF( result( k ).GE.thresh )
THEN
495 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
496 $ CALL
aladhd( nout, path )
497 WRITE( nout, fmt = 9999 )
'CPOSV ', uplo,
498 $ n, imat, k, result( k )
509 $ CALL
claset( uplo, n, n, cmplx( zero ),
510 $ cmplx( zero ), afac, lda )
511 CALL
claset(
'Full', n, nrhs, cmplx( zero ),
512 $ cmplx( zero ), x, lda )
513 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
518 CALL
claqhe( uplo, n, a, lda, s, scond, amax,
526 CALL
cposvx( fact, uplo, n, nrhs, a, lda, afac,
527 $ lda, equed, s, b, lda, x, lda, rcond,
528 $ rwork, rwork( nrhs+1 ), work,
529 $ rwork( 2*nrhs+1 ), info )
534 $ CALL
alaerh( path,
'CPOSVX', info, izero,
535 $ fact // uplo, n, n, -1, -1, nrhs,
536 $ imat, nfail, nerrs, nout )
540 IF( .NOT.prefac )
THEN
545 CALL
cpot01( uplo, n, a, lda, afac, lda,
546 $ rwork( 2*nrhs+1 ), result( 1 ) )
554 CALL
clacpy(
'Full', n, nrhs, bsav, lda, work,
556 CALL
cpot02( uplo, n, nrhs, asav, lda, x, lda,
557 $ work, lda, rwork( 2*nrhs+1 ),
562 IF( nofact .OR. ( prefac .AND.
lsame( equed,
564 CALL
cget04( n, nrhs, x, lda, xact, lda,
565 $ rcondc, result( 3 ) )
567 CALL
cget04( n, nrhs, x, lda, xact, lda,
568 $ roldc, result( 3 ) )
574 CALL
cpot05( uplo, n, nrhs, asav, lda, b, lda,
575 $ x, lda, xact, lda, rwork,
576 $ rwork( nrhs+1 ), result( 4 ) )
584 result( 6 ) =
sget06( rcond, rcondc )
590 IF( result( k ).GE.thresh )
THEN
591 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
592 $ CALL
aladhd( nout, path )
594 WRITE( nout, fmt = 9997 )
'CPOSVX', fact,
595 $ uplo, n, equed, imat, k, result( k )
597 WRITE( nout, fmt = 9998 )
'CPOSVX', fact,
598 $ uplo, n, imat, k, result( k )
609 CALL
clacpy(
'Full', n, n, asav, lda, a, lda )
610 CALL
clacpy(
'Full', n, nrhs, bsav, lda, b, lda )
613 $ CALL
claset( uplo, n, n, cmplx( zero ),
614 $ cmplx( zero ), afac, lda )
615 CALL
claset(
'Full', n, nrhs, cmplx( zero ),
616 $ cmplx( zero ), x, lda )
617 IF( iequed.GT.1 .AND. n.GT.0 )
THEN
622 CALL
claqhe( uplo, n, a, lda, s, scond, amax,
631 CALL
cposvxx( fact, uplo, n, nrhs, a, lda, afac,
632 $ lda, equed, s, b, lda, x,
633 $ lda, rcond, rpvgrw_svxx, berr, n_err_bnds,
634 $ errbnds_n, errbnds_c, 0, zero, work,
635 $ rwork( 2*nrhs+1 ), info )
639 IF( info.EQ.n+1 ) goto 90
640 IF( info.NE.izero )
THEN
641 CALL
alaerh( path,
'CPOSVXX', info, izero,
642 $ fact // uplo, n, n, -1, -1, nrhs,
643 $ imat, nfail, nerrs, nout )
648 IF( .NOT.prefac )
THEN
653 CALL
cpot01( uplo, n, a, lda, afac, lda,
654 $ rwork( 2*nrhs+1 ), result( 1 ) )
662 CALL
clacpy(
'Full', n, nrhs, bsav, lda, work,
664 CALL
cpot02( uplo, n, nrhs, asav, lda, x, lda,
665 $ work, lda, rwork( 2*nrhs+1 ),
670 IF( nofact .OR. ( prefac .AND.
lsame( equed,
672 CALL
cget04( n, nrhs, x, lda, xact, lda,
673 $ rcondc, result( 3 ) )
675 CALL
cget04( n, nrhs, x, lda, xact, lda,
676 $ roldc, result( 3 ) )
682 CALL
cpot05( uplo, n, nrhs, asav, lda, b, lda,
683 $ x, lda, xact, lda, rwork,
684 $ rwork( nrhs+1 ), result( 4 ) )
692 result( 6 ) =
sget06( rcond, rcondc )
698 IF( result( k ).GE.thresh )
THEN
699 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
700 $ CALL
aladhd( nout, path )
702 WRITE( nout, fmt = 9997 )
'CPOSVXX', fact,
703 $ uplo, n, equed, imat, k, result( k )
705 WRITE( nout, fmt = 9998 )
'CPOSVXX', fact,
706 $ uplo, n, imat, k, result( k )
720 CALL
alasvm( path, nout, nfail, nrun, nerrs )
727 9999 format( 1x, a,
', UPLO=''', a1,
''', N =', i5,
', type ', i1,
728 $
', test(', i1,
')=', g12.5 )
729 9998 format( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N=', i5,
730 $
', type ', i1,
', test(', i1,
')=', g12.5 )
731 9997 format( 1x, a,
', FACT=''', a1,
''', UPLO=''', a1,
''', N=', i5,
732 $
', EQUED=''', a1,
''', type ', i1,
', test(', i1,
') =',