217 SUBROUTINE ssbgvd( JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB,
219 $ Z, LDZ, WORK, LWORK, IWORK, LIWORK, INFO )
227 INTEGER INFO, KA, KB, LDAB, LDBB, LDZ, LIWORK, LWORK, N
231 REAL AB( LDAB, * ), BB( LDBB, * ), W( * ),
232 $ work( * ), z( ldz, * )
239 PARAMETER ( ONE = 1.0e+0, zero = 0.0e+0 )
242 LOGICAL LQUERY, UPPER, WANTZ
244 INTEGER IINFO, INDE, INDWK2, INDWRK, LIWMIN, LLWRK2,
250 EXTERNAL lsame, sroundup_lwork
261 wantz = lsame( jobz,
'V' )
262 upper = lsame( uplo,
'U' )
263 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
269 ELSE IF( wantz )
THEN
271 lwmin = 1 + 5*n + 2*n**2
277 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
279 ELSE IF( .NOT.( upper .OR. lsame( uplo,
'L' ) ) )
THEN
281 ELSE IF( n.LT.0 )
THEN
283 ELSE IF( ka.LT.0 )
THEN
285 ELSE IF( kb.LT.0 .OR. kb.GT.ka )
THEN
287 ELSE IF( ldab.LT.ka+1 )
THEN
289 ELSE IF( ldbb.LT.kb+1 )
THEN
291 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
296 work( 1 ) = sroundup_lwork(lwmin)
299 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
301 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
307 CALL xerbla(
'SSBGVD', -info )
309 ELSE IF( lquery )
THEN
320 CALL spbstf( uplo, n, kb, bb, ldbb, info )
330 indwk2 = indwrk + n*n
331 llwrk2 = lwork - indwk2 + 1
332 CALL ssbgst( jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, z, ldz,
342 CALL ssbtrd( vect, uplo, n, ka, ab, ldab, w, work( inde ), z,
344 $ work( indwrk ), iinfo )
348 IF( .NOT.wantz )
THEN
349 CALL ssterf( n, w, work( inde ), info )
351 CALL sstedc(
'I', n, w, work( inde ), work( indwrk ), n,
352 $ work( indwk2 ), llwrk2, iwork, liwork, info )
353 CALL sgemm(
'N',
'N', n, n, n, one, z, ldz, work( indwrk ),
355 $ zero, work( indwk2 ), n )
356 CALL slacpy(
'A', n, n, work( indwk2 ), n, z, ldz )
359 work( 1 ) = sroundup_lwork(lwmin)
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine ssbgst(vect, uplo, n, ka, kb, ab, ldab, bb, ldbb, x, ldx, work, info)
SSBGST
subroutine ssbgvd(jobz, uplo, n, ka, kb, ab, ldab, bb, ldbb, w, z, ldz, work, lwork, iwork, liwork, info)
SSBGVD