243 SUBROUTINE chbgvd( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, W,
244 $ Z, LDZ, WORK, LWORK, RWORK, LRWORK, IWORK,
253 INTEGER INFO, KA, KB, LDAB, LDBB, LDZ, LIWORK, LRWORK,
258 REAL RWORK( * ), W( * )
259 COMPLEX AB( LDAB, * ), BB( LDBB, * ), WORK( * ),
267 PARAMETER ( CONE = ( 1.0e+0, 0.0e+0 ),
268 $ czero = ( 0.0e+0, 0.0e+0 ) )
271 LOGICAL LQUERY, UPPER, WANTZ
273 INTEGER IINFO, INDE, INDWK2, INDWRK, LIWMIN, LLRWK,
274 $ llwk2, lrwmin, lwmin
279 EXTERNAL lsame, sroundup_lwork
289 wantz = lsame( jobz,
'V' )
290 upper = lsame( uplo,
'U' )
291 lquery = ( lwork.EQ.-1 .OR. lrwork.EQ.-1 .OR. liwork.EQ.-1 )
298 ELSE IF( wantz )
THEN
300 lrwmin = 1 + 5*n + 2*n**2
307 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
309 ELSE IF( .NOT.( upper .OR. lsame( uplo,
'L' ) ) )
THEN
311 ELSE IF( n.LT.0 )
THEN
313 ELSE IF( ka.LT.0 )
THEN
315 ELSE IF( kb.LT.0 .OR. kb.GT.ka )
THEN
317 ELSE IF( ldab.LT.ka+1 )
THEN
319 ELSE IF( ldbb.LT.kb+1 )
THEN
321 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
326 work( 1 ) = sroundup_lwork(lwmin)
330 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
332 ELSE IF( lrwork.LT.lrwmin .AND. .NOT.lquery )
THEN
334 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
340 CALL xerbla(
'CHBGVD', -info )
342 ELSE IF( lquery )
THEN
353 CALL cpbstf( uplo, n, kb, bb, ldbb, info )
364 llwk2 = lwork - indwk2 + 2
365 llrwk = lrwork - indwrk + 2
366 CALL chbgst( jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, z, ldz,
367 $ work, rwork, iinfo )
376 CALL chbtrd( vect, uplo, n, ka, ab, ldab, w, rwork( inde ), z,
381 IF( .NOT.wantz )
THEN
382 CALL ssterf( n, w, rwork( inde ), info )
384 CALL cstedc(
'I', n, w, rwork( inde ), work, n, work( indwk2 ),
385 $ llwk2, rwork( indwrk ), llrwk, iwork, liwork,
387 CALL cgemm(
'N',
'N', n, n, n, cone, z, ldz, work, n, czero,
388 $ work( indwk2 ), n )
389 CALL clacpy(
'A', n, n, work( indwk2 ), n, z, ldz )
392 work( 1 ) = sroundup_lwork(lwmin)
subroutine xerbla(srname, info)
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine chbgst(vect, uplo, n, ka, kb, ab, ldab, bb, ldbb, x, ldx, work, rwork, info)
CHBGST
subroutine chbgvd(jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, w, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
CHBGVD
subroutine chbtrd(vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work, info)
CHBTRD
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine cpbstf(uplo, n, kd, ab, ldab, info)
CPBSTF
subroutine cstedc(compz, n, d, e, z, ldz, work, lwork, rwork, lrwork, iwork, liwork, info)
CSTEDC
subroutine ssterf(n, d, e, info)
SSTERF