181 SUBROUTINE zhegv( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
182 $ lwork, rwork, info )
191 INTEGER info, itype, lda, ldb, lwork, n
194 DOUBLE PRECISION rwork( * ), w( * )
195 COMPLEX*16 a( lda, * ), b( ldb, * ), work( * )
202 parameter( one = ( 1.0d+0, 0.0d+0 ) )
205 LOGICAL lquery, upper, wantz
207 INTEGER lwkopt, nb, neig
224 wantz =
lsame( jobz,
'V' )
225 upper =
lsame( uplo,
'U' )
226 lquery = ( lwork.EQ.-1 )
229 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
231 ELSE IF( .NOT.( wantz .OR.
lsame( jobz,
'N' ) ) )
THEN
233 ELSE IF( .NOT.( upper .OR.
lsame( uplo,
'L' ) ) )
THEN
235 ELSE IF( n.LT.0 )
THEN
237 ELSE IF( lda.LT.max( 1, n ) )
THEN
239 ELSE IF( ldb.LT.max( 1, n ) )
THEN
244 nb =
ilaenv( 1,
'ZHETRD', uplo, n, -1, -1, -1 )
245 lwkopt = max( 1, ( nb + 1 )*n )
248 IF( lwork.LT.max( 1, 2*n - 1 ) .AND. .NOT.lquery )
THEN
254 CALL
xerbla(
'ZHEGV ', -info )
256 ELSE IF( lquery )
THEN
267 CALL
zpotrf( uplo, n, b, ldb, info )
275 CALL
zhegst( itype, uplo, n, a, lda, b, ldb, info )
276 CALL
zheev( jobz, uplo, n, a, lda, w, work, lwork, rwork, info )
285 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
296 CALL
ztrsm(
'Left', uplo, trans,
'Non-unit', n, neig, one,
299 ELSE IF( itype.EQ.3 )
THEN
310 CALL
ztrmm(
'Left', uplo, trans,
'Non-unit', n, neig, one,