179 SUBROUTINE dspevd( JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK,
180 $ iwork, liwork, info )
189 INTEGER INFO, LDZ, LIWORK, LWORK, N
193 DOUBLE PRECISION AP( * ), W( * ), WORK( * ), Z( ldz, * )
199 DOUBLE PRECISION ZERO, ONE
200 parameter ( zero = 0.0d+0, one = 1.0d+0 )
203 LOGICAL LQUERY, WANTZ
204 INTEGER IINFO, INDE, INDTAU, INDWRK, ISCALE, LIWMIN,
206 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
211 DOUBLE PRECISION DLAMCH, DLANSP
212 EXTERNAL lsame, dlamch, dlansp
224 wantz = lsame( jobz,
'V' )
225 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
228 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
230 ELSE IF( .NOT.( lsame( uplo,
'U' ) .OR. lsame( uplo,
'L' ) ) )
233 ELSE IF( n.LT.0 )
THEN
235 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
246 lwmin = 1 + 6*n + n**2
255 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
257 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
263 CALL xerbla(
'DSPEVD', -info )
265 ELSE IF( lquery )
THEN
283 safmin = dlamch(
'Safe minimum' )
284 eps = dlamch(
'Precision' )
285 smlnum = safmin / eps
286 bignum = one / smlnum
287 rmin = sqrt( smlnum )
288 rmax = sqrt( bignum )
292 anrm = dlansp(
'M', uplo, n, ap, work )
294 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
297 ELSE IF( anrm.GT.rmax )
THEN
301 IF( iscale.EQ.1 )
THEN
302 CALL dscal( ( n*( n+1 ) ) / 2, sigma, ap, 1 )
309 CALL dsptrd( uplo, n, ap, w, work( inde ), work( indtau ), iinfo )
316 IF( .NOT.wantz )
THEN
317 CALL dsterf( n, w, work( inde ), info )
320 llwork = lwork - indwrk + 1
321 CALL dstedc(
'I', n, w, work( inde ), z, ldz, work( indwrk ),
322 $ llwork, iwork, liwork, info )
323 CALL dopmtr(
'L', uplo,
'N', n, n, ap, work( indtau ), z, ldz,
324 $ work( indwrk ), iinfo )
330 $
CALL dscal( n, one / sigma, w, 1 )
subroutine dsterf(N, D, E, INFO)
DSTERF
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dsptrd(UPLO, N, AP, D, E, TAU, INFO)
DSPTRD
subroutine dscal(N, DA, DX, INCX)
DSCAL
subroutine dstedc(COMPZ, N, D, E, Z, LDZ, WORK, LWORK, IWORK, LIWORK, INFO)
DSTEDC
subroutine dopmtr(SIDE, UPLO, TRANS, M, N, AP, TAU, C, LDC, WORK, INFO)
DOPMTR
subroutine dspevd(JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK, IWORK, LIWORK, INFO)
DSPEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matric...