187 INTEGER nmax, nn, nnb, nns, nout
188 DOUBLE PRECISION thresh
192 INTEGER iwork( * ), nbval( * ), nsval( * ), nval( * )
193 DOUBLE PRECISION rwork( * )
194 COMPLEX*16 a( * ), afac( * ), ainv( * ), b( * ), e( * ),
195 $ work( * ), x( * ), xact( * )
201 DOUBLE PRECISION zero, one
202 parameter ( zero = 0.0d+0, one = 1.0d+0 )
203 DOUBLE PRECISION onehalf
204 parameter ( onehalf = 0.5d+0 )
205 DOUBLE PRECISION eight, sevten
206 parameter ( eight = 8.0d+0, sevten = 17.0d+0 )
208 parameter ( czero = ( 0.0d+0, 0.0d+0 ) )
210 parameter ( ntypes = 10 )
212 parameter ( ntests = 7 )
215 LOGICAL trfcon, zerot
216 CHARACTER dist,
TYPE, uplo, xtype
217 CHARACTER*3 path, matpath
218 INTEGER i, i1, i2, imat, in, inb, info, ioff, irhs,
219 $ itemp, itemp2, iuplo, izero, j, k, kl, ku, lda,
220 $ lwork, mode, n, nb, nerrs, nfail, nimat, nrhs,
222 DOUBLE PRECISION alpha, anorm, cndnum, const, sing_max,
223 $ sing_min, rcond, rcondc, dtemp
227 INTEGER iseed( 4 ), iseedy( 4 ), idummy( 1 )
228 DOUBLE PRECISION result( ntests )
229 COMPLEX*16 block( 2, 2 ), zdummy( 1 )
242 INTRINSIC dconjg, max, min, sqrt
250 COMMON / infoc / infot, nunit, ok, lerr
251 COMMON / srnamc / srnamt
254 DATA iseedy / 1988, 1989, 1990, 1991 /
255 DATA uplos /
'U',
'L' /
261 alpha = ( one+sqrt( sevten ) ) / eight
265 path( 1: 1 ) =
'Zomplex precision'
270 matpath( 1: 1 ) =
'Zomplex precision'
271 matpath( 2: 3 ) =
'HE'
277 iseed( i ) = iseedy( i )
283 $
CALL zerrhe( path, nout )
305 DO 260 imat = 1, nimat
309 IF( .NOT.dotype( imat ) )
314 zerot = imat.GE.3 .AND. imat.LE.6
315 IF( zerot .AND. n.LT.imat-2 )
321 uplo = uplos( iuplo )
328 CALL zlatb4( matpath, imat, n, n,
TYPE, kl, ku, anorm,
329 $ mode, cndnum, dist )
334 CALL zlatms( n, n, dist, iseed,
TYPE, rwork, mode,
335 $ cndnum, anorm, kl, ku, uplo, a, lda,
341 CALL alaerh( path,
'ZLATMS', info, 0, uplo, n, n,
342 $ -1, -1, -1, imat, nfail, nerrs, nout )
356 ELSE IF( imat.EQ.4 )
THEN
366 IF( iuplo.EQ.1 )
THEN
367 ioff = ( izero-1 )*lda
368 DO 20 i = 1, izero - 1
378 DO 40 i = 1, izero - 1
388 IF( iuplo.EQ.1 )
THEN
435 CALL zlacpy( uplo, n, n, a, lda, afac, lda )
442 lwork = max( 2, nb )*lda
444 CALL zhetrf_rk( uplo, n, afac, lda, e, iwork, ainv,
453 IF( iwork( k ).LT.0 )
THEN
454 IF( iwork( k ).NE.-k )
THEN
458 ELSE IF( iwork( k ).NE.k )
THEN
467 $
CALL alaerh( path,
'ZHETRF_RK', info, k,
468 $ uplo, n, n, -1, -1, nb, imat,
469 $ nfail, nerrs, nout )
482 CALL zhet01_3( uplo, n, a, lda, afac, lda, e, iwork,
483 $ ainv, lda, rwork, result( 1 ) )
492 IF( inb.EQ.1 .AND. .NOT.trfcon )
THEN
493 CALL zlacpy( uplo, n, n, afac, lda, ainv, lda )
500 lwork = (n+nb+1)*(nb+3)
501 CALL zhetri_3( uplo, n, ainv, lda, e, iwork, work,
507 $
CALL alaerh( path,
'ZHETRI_3', info, -1,
508 $ uplo, n, n, -1, -1, -1, imat,
509 $ nfail, nerrs, nout )
514 CALL zpot03( uplo, n, a, lda, ainv, lda, work, lda,
515 $ rwork, rcondc, result( 2 ) )
523 IF( result( k ).GE.thresh )
THEN
524 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
525 $
CALL alahd( nout, path )
526 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
539 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) ) /
542 IF( iuplo.EQ.1 )
THEN
551 IF( iwork( k ).GT.zero )
THEN
556 dtemp =
zlange(
'M', k-1, 1,
557 $ afac( ( k-1 )*lda+1 ), lda, rwork )
563 dtemp =
zlange(
'M', k-2, 2,
564 $ afac( ( k-2 )*lda+1 ), lda, rwork )
571 dtemp = dtemp - const + thresh
572 IF( dtemp.GT.result( 3 ) )
573 $ result( 3 ) = dtemp
589 IF( iwork( k ).GT.zero )
THEN
594 dtemp =
zlange(
'M', n-k, 1,
595 $ afac( ( k-1 )*lda+k+1 ), lda, rwork )
601 dtemp =
zlange(
'M', n-k-1, 2,
602 $ afac( ( k-1 )*lda+k+2 ), lda, rwork )
609 dtemp = dtemp - const + thresh
610 IF( dtemp.GT.result( 3 ) )
611 $ result( 3 ) = dtemp
627 const = ( ( alpha**2-one ) / ( alpha**2-onehalf ) )*
628 $ ( ( one + alpha ) / ( one - alpha ) )
629 CALL zlacpy( uplo, n, n, afac, lda, ainv, lda )
631 IF( iuplo.EQ.1 )
THEN
640 IF( iwork( k ).LT.zero )
THEN
646 block( 1, 1 ) = afac( ( k-2 )*lda+k-1 )
647 block( 1, 2 ) = e( k )
648 block( 2, 1 ) = dconjg( block( 1, 2 ) )
649 block( 2, 2 ) = afac( (k-1)*lda+k )
651 CALL zgesvd(
'N',
'N', 2, 2, block, 2, rwork,
652 $ zdummy, 1, zdummy, 1,
653 $ work, 6, rwork( 3 ), info )
656 sing_max = rwork( 1 )
657 sing_min = rwork( 2 )
659 dtemp = sing_max / sing_min
663 dtemp = dtemp - const + thresh
664 IF( dtemp.GT.result( 4 ) )
665 $ result( 4 ) = dtemp
684 IF( iwork( k ).LT.zero )
THEN
690 block( 1, 1 ) = afac( ( k-1 )*lda+k )
691 block( 2, 1 ) = e( k )
692 block( 1, 2 ) = dconjg( block( 2, 1 ) )
693 block( 2, 2 ) = afac( k*lda+k+1 )
695 CALL zgesvd(
'N',
'N', 2, 2, block, 2, rwork,
696 $ zdummy, 1, zdummy, 1,
697 $ work, 6, rwork(3), info )
699 sing_max = rwork( 1 )
700 sing_min = rwork( 2 )
702 dtemp = sing_max / sing_min
706 dtemp = dtemp - const + thresh
707 IF( dtemp.GT.result( 4 ) )
708 $ result( 4 ) = dtemp
723 IF( result( k ).GE.thresh )
THEN
724 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
725 $
CALL alahd( nout, path )
726 WRITE( nout, fmt = 9999 )uplo, n, nb, imat, k,
761 CALL zlarhs( matpath, xtype, uplo,
' ', n, n,
762 $ kl, ku, nrhs, a, lda, xact, lda,
763 $ b, lda, iseed, info )
764 CALL zlacpy(
'Full', n, nrhs, b, lda, x, lda )
767 CALL zhetrs_3( uplo, n, nrhs, afac, lda, e, iwork,
773 $
CALL alaerh( path,
'ZHETRS_3', info, 0,
774 $ uplo, n, n, -1, -1, nrhs, imat,
775 $ nfail, nerrs, nout )
777 CALL zlacpy(
'Full', n, nrhs, b, lda, work, lda )
781 CALL zpot02( uplo, n, nrhs, a, lda, x, lda, work,
782 $ lda, rwork, result( 5 ) )
787 CALL zget04( n, nrhs, x, lda, xact, lda, rcondc,
794 IF( result( k ).GE.thresh )
THEN
795 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
796 $
CALL alahd( nout, path )
797 WRITE( nout, fmt = 9998 )uplo, n, nrhs,
798 $ imat, k, result( k )
812 anorm =
zlanhe(
'1', uplo, n, a, lda, rwork )
814 CALL zhecon_3( uplo, n, afac, lda, e, iwork, anorm,
815 $ rcond, work, info )
820 $
CALL alaerh( path,
'ZHECON_3', info, 0,
821 $ uplo, n, n, -1, -1, -1, imat,
822 $ nfail, nerrs, nout )
826 result( 7 ) =
dget06( rcond, rcondc )
831 IF( result( 7 ).GE.thresh )
THEN
832 IF( nfail.EQ.0 .AND. nerrs.EQ.0 )
833 $
CALL alahd( nout, path )
834 WRITE( nout, fmt = 9997 )uplo, n, imat, 7,
847 CALL alasum( path, nout, nfail, nrun, nerrs )
849 9999
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NB =', i4,
', type ',
850 $ i2,
', test ', i2,
', ratio =', g12.5 )
851 9998
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
', NRHS=', i3,
', type ',
852 $ i2,
', test ', i2,
', ratio =', g12.5 )
853 9997
FORMAT(
' UPLO = ''', a1,
''', N =', i5,
',', 10x,
' type ', i2,
854 $
', test ', i2,
', ratio =', g12.5 )
subroutine alahd(IOUNIT, PATH)
ALAHD
subroutine alaerh(PATH, SUBNAM, INFO, INFOE, OPTS, M, N, KL, KU, N5, IMAT, NFAIL, NERRS, NOUT)
ALAERH
subroutine zhetrf_rk(UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)
ZHETRF_RK computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch...
double precision function zlanhe(NORM, UPLO, N, A, LDA, WORK)
ZLANHE returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex Hermitian matrix.
subroutine zget04(N, NRHS, X, LDX, XACT, LDXACT, RCOND, RESID)
ZGET04
subroutine zhet01_3(UPLO, N, A, LDA, AFAC, LDAFAC, E, IPIV, C, LDC, RWORK, RESID)
ZHET01_3
subroutine zerrhe(PATH, NUNIT)
ZERRHE
subroutine zpot02(UPLO, N, NRHS, A, LDA, X, LDX, B, LDB, RWORK, RESID)
ZPOT02
subroutine zlarhs(PATH, XTYPE, UPLO, TRANS, M, N, KL, KU, NRHS, A, LDA, X, LDX, B, LDB, ISEED, INFO)
ZLARHS
subroutine zhetrs_3(UPLO, N, NRHS, A, LDA, E, IPIV, B, LDB, INFO)
ZHETRS_3
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine xlaenv(ISPEC, NVALUE)
XLAENV
subroutine zpot03(UPLO, N, A, LDA, AINV, LDAINV, WORK, LDWORK, RWORK, RCOND, RESID)
ZPOT03
subroutine zlatb4(PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE, CNDNUM, DIST)
ZLATB4
double precision function zlange(NORM, M, N, A, LDA, WORK)
ZLANGE returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value ...
subroutine zhetri_3(UPLO, N, A, LDA, E, IPIV, WORK, LWORK, INFO)
ZHETRI_3
subroutine zgesvd(JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, WORK, LWORK, RWORK, INFO)
ZGESVD computes the singular value decomposition (SVD) for GE matrices
subroutine zhecon_3(UPLO, N, A, LDA, E, IPIV, ANORM, RCOND, WORK, INFO)
ZHECON_3
double precision function dget06(RCOND, RCONDC)
DGET06
subroutine zlatms(M, N, DIST, ISEED, SYM, D, MODE, COND, DMAX, KL, KU, PACK, A, LDA, WORK, INFO)
ZLATMS
subroutine alasum(TYPE, NOUT, NFAIL, NRUN, NERRS)
ALASUM