146 SUBROUTINE ssbev( JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK,
156 INTEGER info, kd, ldab, ldz, n
159 REAL ab( ldab, * ), w( * ), work( * ), z( ldz, * )
166 parameter( zero = 0.0e0, one = 1.0e0 )
170 INTEGER iinfo, imax, inde, indwrk, iscale
171 REAL anrm, bignum, eps, rmax, rmin, safmin, sigma,
189 wantz =
lsame( jobz,
'V' )
190 lower =
lsame( uplo,
'L' )
193 IF( .NOT.( wantz .OR.
lsame( jobz,
'N' ) ) )
THEN
195 ELSE IF( .NOT.( lower .OR.
lsame( uplo,
'U' ) ) )
THEN
197 ELSE IF( n.LT.0 )
THEN
199 ELSE IF( kd.LT.0 )
THEN
201 ELSE IF( ldab.LT.kd+1 )
THEN
203 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
208 CALL
xerbla(
'SSBEV ', -info )
221 w( 1 ) = ab( kd+1, 1 )
230 safmin =
slamch(
'Safe minimum' )
231 eps =
slamch(
'Precision' )
232 smlnum = safmin / eps
233 bignum = one / smlnum
234 rmin = sqrt( smlnum )
235 rmax = sqrt( bignum )
239 anrm =
slansb(
'M', uplo, n, kd, ab, ldab, work )
241 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
244 ELSE IF( anrm.GT.rmax )
THEN
248 IF( iscale.EQ.1 )
THEN
250 CALL
slascl(
'B', kd, kd, one, sigma, n, n, ab, ldab, info )
252 CALL
slascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
260 CALL
ssbtrd( jobz, uplo, n, kd, ab, ldab, w, work( inde ), z, ldz,
261 $ work( indwrk ), iinfo )
265 IF( .NOT.wantz )
THEN
266 CALL
ssterf( n, w, work( inde ), info )
268 CALL
ssteqr( jobz, n, w, work( inde ), z, ldz, work( indwrk ),
274 IF( iscale.EQ.1 )
THEN
280 CALL
sscal( imax, one / sigma, w, 1 )