211 SUBROUTINE chbev_2stage( JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ,
212 $ work, lwork, rwork, info )
223 INTEGER INFO, KD, LDAB, LDZ, N, LWORK
226 REAL RWORK( * ), W( * )
227 COMPLEX AB( ldab, * ), WORK( * ), Z( ldz, * )
234 parameter ( zero = 0.0e0, one = 1.0e0 )
237 LOGICAL LOWER, WANTZ, LQUERY
238 INTEGER IINFO, IMAX, INDE, INDWRK, INDRWK, ISCALE,
239 $ llwork, lwmin, lhtrd, lwtrd, ib, indhous
240 REAL ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
247 EXTERNAL lsame, slamch, clanhb, ilaenv
260 wantz = lsame( jobz,
'V' )
261 lower = lsame( uplo,
'L' )
262 lquery = ( lwork.EQ.-1 )
265 IF( .NOT.( lsame( jobz,
'N' ) ) )
THEN
267 ELSE IF( .NOT.( lower .OR. lsame( uplo,
'U' ) ) )
THEN
269 ELSE IF( n.LT.0 )
THEN
271 ELSE IF( kd.LT.0 )
THEN
273 ELSE IF( ldab.LT.kd+1 )
THEN
275 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) )
THEN
284 ib = ilaenv( 18,
'CHETRD_HB2ST', jobz, n, kd, -1, -1 )
285 lhtrd = ilaenv( 19,
'CHETRD_HB2ST', jobz, n, kd, ib, -1 )
286 lwtrd = ilaenv( 20,
'CHETRD_HB2ST', jobz, n, kd, ib, -1 )
287 lwmin = lhtrd + lwtrd
291 IF( lwork.LT.lwmin .AND. .NOT.lquery )
296 CALL xerbla(
'CHBEV_2STAGE ', -info )
298 ELSE IF( lquery )
THEN
309 w( 1 ) =
REAL( AB( 1, 1 ) )
311 w( 1 ) =
REAL( AB( KD+1, 1 ) )
320 safmin = slamch(
'Safe minimum' )
321 eps = slamch(
'Precision' )
322 smlnum = safmin / eps
323 bignum = one / smlnum
324 rmin = sqrt( smlnum )
325 rmax = sqrt( bignum )
329 anrm = clanhb(
'M', uplo, n, kd, ab, ldab, rwork )
331 IF( anrm.GT.zero .AND. anrm.LT.rmin )
THEN
334 ELSE IF( anrm.GT.rmax )
THEN
338 IF( iscale.EQ.1 )
THEN
340 CALL clascl(
'B', kd, kd, one, sigma, n, n, ab, ldab, info )
342 CALL clascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
350 indwrk = indhous + lhtrd
351 llwork = lwork - indwrk + 1
353 CALL chetrd_hb2st(
"N", jobz, uplo, n, kd, ab, ldab, w,
354 $ rwork( inde ), work( indhous ), lhtrd,
355 $ work( indwrk ), llwork, iinfo )
359 IF( .NOT.wantz )
THEN
360 CALL ssterf( n, w, rwork( inde ), info )
363 CALL csteqr( jobz, n, w, rwork( inde ), z, ldz,
364 $ rwork( indrwk ), info )
369 IF( iscale.EQ.1 )
THEN
375 CALL sscal( imax, one / sigma, w, 1 )
subroutine csteqr(COMPZ, N, D, E, Z, LDZ, WORK, INFO)
CSTEQR
subroutine clascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
CLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine chetrd_2stage(VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)
CHETRD_2STAGE
subroutine sscal(N, SA, SX, INCX)
SSCAL
subroutine ssterf(N, D, E, INFO)
SSTERF
subroutine chbev_2stage(JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK, LWORK, RWORK, INFO)
CHBEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER ...