183 SUBROUTINE ssyev_2stage( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK,
195 INTEGER INFO, LDA, LWORK, N
198 REAL A( lda, * ), W( * ), WORK( * )
205 parameter ( zero = 0.0e0, one = 1.0e0 )
208 LOGICAL LOWER, LQUERY, WANTZ
209 INTEGER IINFO, IMAX, INDE, INDTAU, INDWRK, ISCALE,
210 $ llwork, lwmin, lhtrd, lwtrd, kd, ib, indhous
211 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
218 EXTERNAL lsame, ilaenv, slamch, slansy
231 wantz = lsame( jobz,
'V' )
232 lower = lsame( uplo,
'L' )
233 lquery = ( lwork.EQ.-1 )
236 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
238 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
240 ELSE IF( n.LT.0 )
THEN
242 ELSE IF( lda.LT.max( 1, n ) )
THEN
247 kd = ilaenv( 17,
'SSYTRD_2STAGE', jobz, n, -1, -1, -1 )
248 ib = ilaenv( 18,
'SSYTRD_2STAGE', jobz, n, kd, -1, -1 )
249 lhtrd = ilaenv( 19,
'SSYTRD_2STAGE', jobz, n, kd, ib, -1 )
250 lwtrd = ilaenv( 20,
'SSYTRD_2STAGE', jobz, n, kd, ib, -1 )
251 lwmin = 2*n + lhtrd + lwtrd
254 IF( lwork.LT.lwmin .AND. .NOT.lquery )
259 CALL xerbla(
'SSYEV_2STAGE ', -info )
261 ELSE IF( lquery )
THEN
281 safmin = slamch(
'Safe minimum' )
282 eps = slamch(
'Precision' )
283 smlnum = safmin / eps
284 bignum = one / smlnum
285 rmin = sqrt( smlnum )
286 rmax = sqrt( bignum )
290 anrm = slansy(
'M', uplo, n, a, lda, work )
292 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
295 ELSE IF( anrm.GT.rmax )
THEN
300 $
CALL slascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
307 indwrk = indhous + lhtrd
308 llwork = lwork - indwrk + 1
311 $ work( indtau ), work( indhous ), lhtrd,
312 $ work( indwrk ), llwork, iinfo )
317 IF( .NOT.wantz )
THEN
318 CALL ssterf( n, w, work( inde ), info )
323 CALL sorgtr( uplo, n, a, lda, work( indtau ), work( indwrk ),
325 CALL ssteqr( jobz, n, w, work( inde ), a, lda, work( indtau ),
331 IF( iscale.EQ.1 )
THEN
337 CALL sscal( imax, one / sigma, w, 1 )
subroutine ssyev_2stage(JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO)
SSYEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY mat...
subroutine ssteqr(COMPZ, N, D, E, Z, LDZ, WORK, INFO)
SSTEQR
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine slascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine sscal(N, SA, SX, INCX)
SSCAL
subroutine ssytrd_2stage(VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)
SSYTRD_2STAGE
subroutine ssterf(N, D, E, INFO)
SSTERF
subroutine sorgtr(UPLO, N, A, LDA, TAU, WORK, LWORK, INFO)
SORGTR