174 SUBROUTINE ssyevd( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, IWORK,
183 INTEGER INFO, LDA, LIWORK, LWORK, N
187 REAL A( LDA, * ), W( * ), WORK( * )
194 parameter( zero = 0.0e+0, one = 1.0e+0 )
198 LOGICAL LOWER, LQUERY, WANTZ
199 INTEGER IINFO, INDE, INDTAU, INDWK2, INDWRK, ISCALE,
200 $ liopt, liwmin, llwork, llwrk2, lopt, lwmin
201 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
207 REAL SLAMCH, SLANSY, SROUNDUP_LWORK
208 EXTERNAL ilaenv, lsame, slamch, slansy, sroundup_lwork
221 wantz = lsame( jobz,
'V' )
222 lower = lsame( uplo,
'L' )
223 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
226 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
228 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
230 ELSE IF( n.LT.0 )
THEN
232 ELSE IF( lda.LT.max( 1, n ) )
THEN
245 lwmin = 1 + 6*n + 2*n**2
250 lopt = max( lwmin, 2*n +
251 $ n*ilaenv( 1,
'SSYTRD', uplo, n, -1, -1, -1 ) )
254 work( 1 ) = sroundup_lwork(lopt)
257 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
259 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
265 CALL xerbla(
'SSYEVD', -info )
267 ELSE IF( lquery )
THEN
285 safmin = slamch(
'Safe minimum' )
286 eps = slamch(
'Precision' )
287 smlnum = safmin / eps
288 bignum = one / smlnum
289 rmin = sqrt( smlnum )
290 rmax = sqrt( bignum )
294 anrm = slansy(
'M', uplo, n, a, lda, work )
296 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
299 ELSE IF( anrm.GT.rmax )
THEN
304 $
CALL slascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
311 llwork = lwork - indwrk + 1
312 indwk2 = indwrk + n*n
313 llwrk2 = lwork - indwk2 + 1
315 CALL ssytrd( uplo, n, a, lda, w, work( inde ), work( indtau ),
316 $ work( indwrk ), llwork, iinfo )
323 IF( .NOT.wantz )
THEN
324 CALL ssterf( n, w, work( inde ), info )
326 CALL sstedc(
'I', n, w, work( inde ), work( indwrk ), n,
327 $ work( indwk2 ), llwrk2, iwork, liwork, info )
328 CALL sormtr(
'L', uplo,
'N', n, n, a, lda, work( indtau ),
329 $ work( indwrk ), n, work( indwk2 ), llwrk2, iinfo )
330 CALL slacpy(
'A', n, n, work( indwrk ), n, a, lda )
336 $
CALL sscal( n, one / sigma, w, 1 )
338 work( 1 ) = sroundup_lwork(lopt)
subroutine xerbla(srname, info)
subroutine ssyevd(jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork, info)
SSYEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for SY matrices
subroutine ssytrd(uplo, n, a, lda, d, e, tau, work, lwork, info)
SSYTRD
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
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 sstedc(compz, n, d, e, z, ldz, work, lwork, iwork, liwork, info)
SSTEDC
subroutine ssterf(n, d, e, info)
SSTERF
subroutine sormtr(side, uplo, trans, m, n, a, lda, tau, c, ldc, work, lwork, info)
SORMTR