239 SUBROUTINE zhegvd( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W,
241 $ LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO )
249 INTEGER INFO, ITYPE, LDA, LDB, LIWORK, LRWORK, LWORK, N
253 DOUBLE PRECISION RWORK( * ), W( * )
254 COMPLEX*16 A( LDA, * ), B( LDB, * ), WORK( * )
261 PARAMETER ( CONE = ( 1.0d+0, 0.0d+0 ) )
264 LOGICAL LQUERY, UPPER, WANTZ
266 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
320 rwork( 1 ) = real( lropt )
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,
357 $ iwork, liwork, info )
358 lopt = int( max( dble( lopt ), dble( work( 1 ) ) ) )
359 lropt = int( max( dble( lropt ), dble( rwork( 1 ) ) ) )
360 liopt = int( max( dble( liopt ), dble( iwork( 1 ) ) ) )
362 IF( wantz .AND. info.EQ.0 )
THEN
366 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
377 CALL ztrsm(
'Left', uplo, trans,
'Non-unit', n, n, cone,
380 ELSE IF( itype.EQ.3 )
THEN
391 CALL ztrmm(
'Left', uplo, trans,
'Non-unit', n, n, cone,
397 rwork( 1 ) = real( lropt )
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 zhegvd(itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHEGVD
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