241 SUBROUTINE chbgvd( 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 REAL RWORK( * ), W( * )
258 COMPLEX AB( LDAB, * ), BB( LDBB, * ), WORK( * ),
266 PARAMETER ( CONE = ( 1.0e+0, 0.0e+0 ),
267 $ czero = ( 0.0e+0, 0.0e+0 ) )
270 LOGICAL LQUERY, UPPER, WANTZ
272 INTEGER IINFO, INDE, INDWK2, INDWRK, LIWMIN, LLRWK,
273 $ llwk2, lrwmin, lwmin
278 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)
327 rwork( 1 ) = real( lrwmin )
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,
386 $ llwk2, rwork( indwrk ), llrwk, iwork, liwork,
388 CALL cgemm(
'N',
'N', n, n, n, cone, z, ldz, work, n, czero,
389 $ work( indwk2 ), n )
390 CALL clacpy(
'A', n, n, work( indwk2 ), n, z, ldz )
393 work( 1 ) = sroundup_lwork(lwmin)
394 rwork( 1 ) = real( lrwmin )
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