241 SUBROUTINE zhbgvd( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB,
243 $ Z, LDZ, WORK, LWORK, RWORK, LRWORK, IWORK,
252 INTEGER INFO, KA, KB, LDAB, LDBB, LDZ, LIWORK, LRWORK,
257 DOUBLE PRECISION RWORK( * ), W( * )
258 COMPLEX*16 AB( LDAB, * ), BB( LDBB, * ), WORK( * ),
265 COMPLEX*16 CONE, CZERO
266 PARAMETER ( CONE = ( 1.0d+0, 0.0d+0 ),
267 $ czero = ( 0.0d+0, 0.0d+0 ) )
270 LOGICAL LQUERY, UPPER, WANTZ
272 INTEGER IINFO, INDE, INDWK2, INDWRK, LIWMIN, LLRWK,
273 $ llwk2, lrwmin, lwmin
288 wantz = lsame( jobz,
'V' )
289 upper = lsame( uplo,
'U' )
290 lquery = ( lwork.EQ.-1 .OR. lrwork.EQ.-1 .OR. liwork.EQ.-1 )
297 ELSE IF( wantz )
THEN
299 lrwmin = 1 + 5*n + 2*n**2
306 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( ka.LT.0 )
THEN
314 ELSE IF( kb.LT.0 .OR. kb.GT.ka )
THEN
316 ELSE IF( ldab.LT.ka+1 )
THEN
318 ELSE IF( ldbb.LT.kb+1 )
THEN
320 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
326 rwork( 1 ) = real( lrwmin )
329 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
331 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
333 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
339 CALL xerbla(
'ZHBGVD', -info )
341 ELSE IF( lquery )
THEN
352 CALL zpbstf( uplo, n, kb, bb, ldbb, info )
363 llwk2 = lwork - indwk2 + 2
364 llrwk = lrwork - indwrk + 2
365 CALL zhbgst( jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, z, ldz,
366 $ work, rwork, iinfo )
375 CALL zhbtrd( vect, uplo, n, ka, ab, ldab, w, rwork( inde ), z,
380 IF( .NOT.wantz )
THEN
381 CALL dsterf( n, w, rwork( inde ), info )
383 CALL zstedc(
'I', n, w, rwork( inde ), work, n,
385 $ llwk2, rwork( indwrk ), llrwk, iwork, liwork,
387 CALL zgemm(
'N',
'N', n, n, n, cone, z, ldz, work, n, czero,
388 $ work( indwk2 ), n )
389 CALL zlacpy(
'A', n, n, work( indwk2 ), n, z, ldz )
393 rwork( 1 ) = real( lrwmin )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zhbgst(vect, uplo, n, ka, kb, ab, ldab, bb, ldbb, x, ldx, work, rwork, info)
ZHBGST
subroutine zhbgvd(jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, w, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZHBGVD
subroutine zstedc(compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
ZSTEDC