183 SUBROUTINE ssbevd( JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ,
185 $ LWORK, IWORK, LIWORK, INFO )
193 INTEGER INFO, KD, LDAB, LDZ, LIWORK, LWORK, N
197 REAL AB( LDAB, * ), W( * ), WORK( * ), Z( LDZ, * )
204 PARAMETER ( ZERO = 0.0e+0, one = 1.0e+0 )
207 LOGICAL LOWER, LQUERY, WANTZ
208 INTEGER IINFO, INDE, INDWK2, INDWRK, ISCALE, LIWMIN,
210 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
215 REAL SLAMCH, SLANSB, SROUNDUP_LWORK
216 EXTERNAL lsame, slamch, slansb,
231 wantz = lsame( jobz,
'V' )
232 lower = lsame( uplo,
'L' )
233 lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
242 lwmin = 1 + 5*n + 2*n**2
248 IF( .NOT.( wantz .OR. lsame( jobz,
'N' ) ) )
THEN
250 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
252 ELSE IF( n.LT.0 )
THEN
254 ELSE IF( kd.LT.0 )
THEN
256 ELSE IF( ldab.LT.kd+1 )
THEN
258 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
263 work( 1 ) = sroundup_lwork(lwmin)
266 IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
268 ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery )
THEN
274 CALL xerbla(
'SSBEVD', -info )
276 ELSE IF( lquery )
THEN
294 safmin = slamch(
'Safe minimum' )
295 eps = slamch(
'Precision' )
296 smlnum = safmin / eps
297 bignum = one / smlnum
298 rmin = sqrt( smlnum )
299 rmax = sqrt( bignum )
303 anrm = slansb(
'M', uplo, n, kd, ab, ldab, work )
305 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
308 ELSE IF( anrm.GT.rmax )
THEN
312 IF( iscale.EQ.1 )
THEN
314 CALL slascl(
'B', kd, kd, one, sigma, n, n, ab, ldab,
317 CALL slascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab,
326 indwk2 = indwrk + n*n
327 llwrk2 = lwork - indwk2 + 1
328 CALL ssbtrd( jobz, uplo, n, kd, ab, ldab, w, work( inde ), z,
330 $ work( indwrk ), iinfo )
334 IF( .NOT.wantz )
THEN
335 CALL ssterf( n, w, work( inde ), info )
337 CALL sstedc(
'I', n, w, work( inde ), work( indwrk ), n,
338 $ work( indwk2 ), llwrk2, iwork, liwork, info )
339 CALL sgemm(
'N',
'N', n, n, n, one, z, ldz, work( indwrk ),
341 $ zero, work( indwk2 ), n )
342 CALL slacpy(
'A', n, n, work( indwk2 ), n, z, ldz )
348 $
CALL sscal( n, one / sigma, w, 1 )
350 work( 1 ) = sroundup_lwork(lwmin)
subroutine ssbevd(jobz, uplo, n, kd, ab, ldab, w, z, ldz, work, lwork, iwork, liwork, info)
SSBEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrice...