227 $ WORK, LWORK, IWORK, LIWORK, INFO )
237 INTEGER INFO, KD, LDAB, LDZ, LIWORK, LWORK, N
241 DOUBLE PRECISION AB( LDAB, * ), W( * ), WORK( * ), Z( LDZ, * )
247 DOUBLE PRECISION ZERO, ONE
248 parameter( zero = 0.0d+0, one = 1.0d+0 )
251 LOGICAL LOWER, LQUERY, WANTZ
252 INTEGER IINFO, INDE, INDWK2, INDWRK, ISCALE, LIWMIN,
253 $ llwork, lwmin, lhtrd, lwtrd, ib, indhous,
255 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
261 DOUBLE PRECISION DLAMCH, DLANSB
262 EXTERNAL lsame, dlamch, dlansb, ilaenv2stage
275 wantz = lsame( jobz,
'V' )
276 lower = lsame( uplo,
'L' )
277 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
284 ib = ilaenv2stage( 2,
'DSYTRD_SB2ST', jobz, n, kd, -1, -1 )
285 lhtrd = ilaenv2stage( 3,
'DSYTRD_SB2ST', jobz, n, kd, ib, -1 )
286 lwtrd = ilaenv2stage( 4,
'DSYTRD_SB2ST', jobz, n, kd, ib, -1 )
289 lwmin = 1 + 5*n + 2*n**2
292 lwmin = max( 2*n, n+lhtrd+lwtrd )
295 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
297 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
299 ELSE IF( n.LT.0 )
THEN
301 ELSE IF( kd.LT.0 )
THEN
303 ELSE IF( ldab.LT.kd+1 )
THEN
305 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
313 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
315 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
321 CALL xerbla(
'DSBEVD_2STAGE', -info )
323 ELSE IF( lquery )
THEN
341 safmin = dlamch(
'Safe minimum' )
342 eps = dlamch(
'Precision' )
343 smlnum = safmin / eps
344 bignum = one / smlnum
345 rmin = sqrt( smlnum )
346 rmax = sqrt( bignum )
350 anrm = dlansb(
'M', uplo, n, kd, ab, ldab, work )
352 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
355 ELSE IF( anrm.GT.rmax )
THEN
359 IF( iscale.EQ.1 )
THEN
361 CALL dlascl(
'B', kd, kd, one, sigma, n, n, ab, ldab, info )
363 CALL dlascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
371 indwrk = indhous + lhtrd
372 llwork = lwork - indwrk + 1
373 indwk2 = indwrk + n*n
374 llwrk2 = lwork - indwk2 + 1
377 $ work( inde ), work( indhous ), lhtrd,
378 $ work( indwrk ), llwork, iinfo )
382 IF( .NOT.wantz )
THEN
383 CALL dsterf( n, w, work( inde ), info )
385 CALL dstedc(
'I', n, w, work( inde ), work( indwrk ), n,
386 $ work( indwk2 ), llwrk2, iwork, liwork, info )
387 CALL dgemm(
'N',
'N', n, n, n, one, z, ldz, work( indwrk ), n,
388 $ zero, work( indwk2 ), n )
389 CALL dlacpy(
'A', n, n, work( indwk2 ), n, z, ldz )
395 $
CALL dscal( n, one / sigma, w, 1 )
subroutine xerbla(srname, info)
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dsbevd_2stage(jobz, uplo, n, kd, ab, ldab, w, z, ldz, work, lwork, iwork, liwork, info)
DSBEVD_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER ...
subroutine dsytrd_sb2st(stage1, vect, uplo, n, kd, ab, ldab, d, e, hous, lhous, work, lwork, info)
DSYTRD_SB2ST reduces a real symmetric band matrix A to real symmetric tridiagonal form T
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine dscal(n, da, dx, incx)
DSCAL
subroutine dstedc(compz, n, d, e, z, ldz, work, lwork, iwork, liwork, info)
DSTEDC
subroutine dsterf(n, d, e, info)
DSTERF