249 SUBROUTINE zhegvd( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
250 $ lwork, rwork, lrwork, iwork, liwork, info )
259 INTEGER info, itype, lda, ldb, liwork, lrwork, lwork, n
263 DOUBLE PRECISION rwork( * ), w( * )
264 COMPLEX*16 a( lda, * ), b( ldb, * ), work( * )
271 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
274 LOGICAL lquery, upper, wantz
276 INTEGER liopt, liwmin, lopt, lropt, lrwmin, lwmin
292 wantz =
lsame( jobz,
'V' )
293 upper =
lsame( uplo,
'U' )
294 lquery = ( lwork.EQ.-1 .OR. lrwork.EQ.-1 .OR. liwork.EQ.-1 )
301 ELSE IF( wantz )
THEN
303 lrwmin = 1 + 5*n + 2*n*n
313 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
315 ELSE IF( .NOT.( wantz .OR.
lsame( jobz,
'N' ) ) )
THEN
317 ELSE IF( .NOT.( upper .OR.
lsame( uplo,
'L' ) ) )
THEN
319 ELSE IF( n.LT.0 )
THEN
321 ELSE IF( lda.LT.max( 1, n ) )
THEN
323 ELSE IF( ldb.LT.max( 1, n ) )
THEN
332 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
334 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
336 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
342 CALL
xerbla(
'ZHEGVD', -info )
344 ELSE IF( lquery )
THEN
355 CALL
zpotrf( uplo, n, b, ldb, info )
363 CALL
zhegst( itype, uplo, n, a, lda, b, ldb, info )
364 CALL
zheevd( jobz, uplo, n, a, lda, w, work, lwork, rwork, lrwork,
365 $ iwork, liwork, info )
366 lopt = max( dble( lopt ), dble( work( 1 ) ) )
367 lropt = max( dble( lropt ), dble( rwork( 1 ) ) )
368 liopt = max( dble( liopt ), dble( iwork( 1 ) ) )
370 IF( wantz .AND. info.EQ.0 )
THEN
374 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
385 CALL
ztrsm(
'Left', uplo, trans,
'Non-unit', n, n, cone,
388 ELSE IF( itype.EQ.3 )
THEN
399 CALL
ztrmm(
'Left', uplo, trans,
'Non-unit', n, n, cone,