204 SUBROUTINE dsbev_2stage( JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ,
205 $ work, lwork, info )
216 INTEGER INFO, KD, LDAB, LDZ, N, LWORK
219 DOUBLE PRECISION AB( ldab, * ), W( * ), WORK( * ), Z( ldz, * )
225 DOUBLE PRECISION ZERO, ONE
226 parameter ( zero = 0.0d0, one = 1.0d0 )
229 LOGICAL LOWER, WANTZ, LQUERY
230 INTEGER IINFO, IMAX, INDE, INDWRK, ISCALE,
231 $ llwork, lwmin, lhtrd, lwtrd, ib, indhous
232 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
238 DOUBLE PRECISION DLAMCH, DLANSB
239 EXTERNAL lsame, dlamch, dlansb, ilaenv
252 wantz = lsame( jobz,
'V' )
253 lower = lsame( uplo,
'L' )
254 lquery = ( lwork.EQ.-1 )
257 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
259 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
261 ELSE IF( n.LT.0 )
THEN
263 ELSE IF( kd.LT.0 )
THEN
265 ELSE IF( ldab.LT.kd+1 )
THEN
267 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
276 ib = ilaenv( 18,
'DSYTRD_SB2ST', jobz, n, kd, -1, -1 )
277 lhtrd = ilaenv( 19,
'DSYTRD_SB2ST', jobz, n, kd, ib, -1 )
278 lwtrd = ilaenv( 20,
'DSYTRD_SB2ST', jobz, n, kd, ib, -1 )
279 lwmin = n + lhtrd + lwtrd
283 IF( lwork.LT.lwmin .AND. .NOT.lquery )
288 CALL xerbla(
'DSBEV_2STAGE ', -info )
290 ELSE IF( lquery )
THEN
303 w( 1 ) = ab( kd+1, 1 )
312 safmin = dlamch(
'Safe minimum' )
313 eps = dlamch(
'Precision' )
314 smlnum = safmin / eps
315 bignum = one / smlnum
316 rmin = sqrt( smlnum )
317 rmax = sqrt( bignum )
321 anrm = dlansb(
'M', uplo, n, kd, ab, ldab, work )
323 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
326 ELSE IF( anrm.GT.rmax )
THEN
330 IF( iscale.EQ.1 )
THEN
332 CALL dlascl(
'B', kd, kd, one, sigma, n, n, ab, ldab, info )
334 CALL dlascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
342 indwrk = indhous + lhtrd
343 llwork = lwork - indwrk + 1
345 CALL dsytrd_sb2st(
"N", jobz, uplo, n, kd, ab, ldab, w,
346 $ work( inde ), work( indhous ), lhtrd,
347 $ work( indwrk ), llwork, iinfo )
351 IF( .NOT.wantz )
THEN
352 CALL dsterf( n, w, work( inde ), info )
354 CALL dsteqr( jobz, n, w, work( inde ), z, ldz, work( indwrk ),
360 IF( iscale.EQ.1 )
THEN
366 CALL dscal( imax, one / sigma, w, 1 )
subroutine dsteqr(COMPZ, N, D, E, Z, LDZ, WORK, INFO)
DSTEQR
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 dsterf(N, D, E, INFO)
DSTERF
subroutine dsbev_2stage(JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK, LWORK, INFO)
DSBEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER ...
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dscal(N, DA, DX, INCX)
DSCAL