227 SUBROUTINE dsygvd( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK,
228 $ lwork, iwork, liwork, info )
237 INTEGER info, itype, lda, ldb, liwork, lwork, n
241 DOUBLE PRECISION a( lda, * ), b( ldb, * ), w( * ), work( * )
248 parameter( one = 1.0d+0 )
251 LOGICAL lquery, upper, wantz
253 INTEGER liopt, liwmin, lopt, lwmin
269 wantz =
lsame( jobz,
'V' )
270 upper =
lsame( uplo,
'U' )
271 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
277 ELSE IF( wantz )
THEN
279 lwmin = 1 + 6*n + 2*n**2
286 IF( itype.LT.1 .OR. itype.GT.3 )
THEN
288 ELSE IF( .NOT.( wantz .OR.
lsame( jobz,
'N' ) ) )
THEN
290 ELSE IF( .NOT.( upper .OR.
lsame( uplo,
'L' ) ) )
THEN
292 ELSE IF( n.LT.0 )
THEN
294 ELSE IF( lda.LT.max( 1, n ) )
THEN
296 ELSE IF( ldb.LT.max( 1, n ) )
THEN
304 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
306 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
312 CALL
xerbla(
'DSYGVD', -info )
314 ELSE IF( lquery )
THEN
325 CALL
dpotrf( uplo, n, b, ldb, info )
333 CALL
dsygst( itype, uplo, n, a, lda, b, ldb, info )
334 CALL
dsyevd( jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork,
336 lopt = max( dble( lopt ), dble( work( 1 ) ) )
337 liopt = max( dble( liopt ), dble( iwork( 1 ) ) )
339 IF( wantz .AND. info.EQ.0 )
THEN
343 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
354 CALL
dtrsm(
'Left', uplo, trans,
'Non-unit', n, n, one,
357 ELSE IF( itype.EQ.3 )
THEN
368 CALL
dtrmm(
'Left', uplo, trans,
'Non-unit', n, n, one,