227 SUBROUTINE ssygvd( 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 REAL a( lda, * ), b( ldb, * ), w( * ), work( * )
248 parameter( one = 1.0e+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(
'SSYGVD', -info )
314 ELSE IF( lquery )
THEN
325 CALL
spotrf( uplo, n, b, ldb, info )
333 CALL
ssygst( itype, uplo, n, a, lda, b, ldb, info )
334 CALL
ssyevd( jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork,
336 lopt = max(
REAL( LOPT ),
REAL( WORK( 1 ) ) )
337 liopt = max(
REAL( LIOPT ),
REAL( IWORK( 1 ) ) )
339 IF( wantz .AND. info.EQ.0 )
THEN
343 IF( itype.EQ.1 .OR. itype.EQ.2 )
THEN
354 CALL
strsm(
'Left', uplo, trans,
'Non-unit', n, n, one,
357 ELSE IF( itype.EQ.3 )
THEN
368 CALL
strmm(
'Left', uplo, trans,
'Non-unit', n, n, one,