241 SUBROUTINE zhegvd( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
242 $ LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO )
250 INTEGER INFO, ITYPE, LDA, LDB, LIWORK, LRWORK, LWORK, N
254 DOUBLE PRECISION RWORK( * ), W( * )
255 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
262 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
265 LOGICAL LQUERY, UPPER, WANTZ
267 INTEGER LIOPT, LIWMIN, LOPT, LROPT, LRWMIN, LWMIN
283 wantz = lsame( jobz,
'V' )
284 upper = lsame( uplo,
'U' )
285 lquery = ( lwork.EQ.-1 .OR. lrwork.EQ.-1 .OR. liwork.EQ.-1 )
292 ELSE IF( wantz )
THEN
294 lrwmin = 1 + 5*n + 2*n*n
304 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
306 ELSE IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
308 ELSE IF( .NOT.( upper .OR. lsame( uplo,
'L' ) ) )
THEN
310 ELSE IF( n.LT.0 )
THEN
312 ELSE IF( lda.LT.max( 1, n ) )
THEN
314 ELSE IF( ldb.LT.max( 1, n ) )
THEN
323 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
325 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
327 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
333 CALL xerbla(
'ZHEGVD', -info )
335 ELSE IF( lquery )
THEN
346 CALL zpotrf( uplo, n, b, ldb, info )
354 CALL zhegst( itype, uplo, n, a, lda, b, ldb, info )
355 CALL zheevd( jobz, uplo, n, a, lda, w, work, lwork, rwork, lrwork,
356 $ iwork, liwork, info )
357 lopt = int( max( dble( lopt ), dble( work( 1 ) ) ) )
358 lropt = int( max( dble( lropt ), dble( rwork( 1 ) ) ) )
359 liopt = int( max( dble( liopt ), dble( iwork( 1 ) ) ) )
361 IF( wantz .AND. info.EQ.0 )
THEN
365 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
376 CALL ztrsm(
'Left', uplo, trans,
'Non-unit', n, n, cone,
379 ELSE IF( itype.EQ.3 )
THEN
390 CALL ztrmm(
'Left', uplo, trans,
'Non-unit', n, n, cone,
subroutine xerbla(srname, info)
subroutine zheevd(jobz, uplo, n, a, lda, w, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHEEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for HE matrices
subroutine zhegst(itype, uplo, n, a, lda, b, ldb, info)
ZHEGST
subroutine zhegvd(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHEGVD
subroutine zpotrf(uplo, n, a, lda, info)
ZPOTRF
subroutine ztrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRMM
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM