133 SUBROUTINE ssyev( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, INFO )
142 INTEGER info, lda, lwork, n
145 REAL a( lda, * ), w( * ), work( * )
152 parameter( zero = 0.0e0, one = 1.0e0 )
155 LOGICAL lower, lquery, wantz
156 INTEGER iinfo, imax, inde, indtau, indwrk, iscale,
158 REAL anrm, bignum, eps, rmax, rmin, safmin, sigma,
178 wantz =
lsame( jobz,
'V' )
179 lower =
lsame( uplo,
'L' )
180 lquery = ( lwork.EQ.-1 )
183 IF( .NOT.( wantz .OR.
lsame( jobz,
'N' ) ) )
THEN
185 ELSE IF( .NOT.( lower .OR.
lsame( uplo,
'U' ) ) )
THEN
187 ELSE IF( n.LT.0 )
THEN
189 ELSE IF( lda.LT.max( 1, n ) )
THEN
194 nb =
ilaenv( 1,
'SSYTRD', uplo, n, -1, -1, -1 )
195 lwkopt = max( 1, ( nb+2 )*n )
198 IF( lwork.LT.max( 1, 3*n-1 ) .AND. .NOT.lquery )
203 CALL
xerbla(
'SSYEV ', -info )
205 ELSE IF( lquery )
THEN
225 safmin =
slamch(
'Safe minimum' )
226 eps =
slamch(
'Precision' )
227 smlnum = safmin / eps
228 bignum = one / smlnum
229 rmin = sqrt( smlnum )
230 rmax = sqrt( bignum )
234 anrm =
slansy(
'M', uplo, n, a, lda, work )
236 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
239 ELSE IF( anrm.GT.rmax )
THEN
244 $ CALL
slascl( uplo, 0, 0, one, sigma, n, n, a, lda, info )
251 llwork = lwork - indwrk + 1
252 CALL
ssytrd( uplo, n, a, lda, w, work( inde ), work( indtau ),
253 $ work( indwrk ), llwork, iinfo )
258 IF( .NOT.wantz )
THEN
259 CALL
ssterf( n, w, work( inde ), info )
261 CALL
sorgtr( uplo, n, a, lda, work( indtau ), work( indwrk ),
263 CALL
ssteqr( jobz, n, w, work( inde ), a, lda, work( indtau ),
269 IF( iscale.EQ.1 )
THEN
275 CALL
sscal( imax, one / sigma, w, 1 )