211 SUBROUTINE zhbev_2stage( JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ,
212 $ work, lwork, rwork, info )
223 INTEGER INFO, KD, LDAB, LDZ, N, LWORK
226 DOUBLE PRECISION RWORK( * ), W( * )
227 COMPLEX*16 AB( ldab, * ), WORK( * ), Z( ldz, * )
233 DOUBLE PRECISION ZERO, ONE
234 parameter ( zero = 0.0d0, one = 1.0d0 )
237 LOGICAL LOWER, WANTZ, LQUERY
238 INTEGER IINFO, IMAX, INDE, INDWRK, INDRWK, ISCALE,
239 $ llwork, lwmin, lhtrd, lwtrd, ib, indhous
240 DOUBLE PRECISION ANRM, BIGNUM, EPS, RMAX, RMIN, SAFMIN, SIGMA,
246 DOUBLE PRECISION DLAMCH, ZLANHB
247 EXTERNAL lsame, dlamch, zlanhb, 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,
'ZHETRD_HB2ST', jobz, n, kd, -1, -1 )
285 lhtrd = ilaenv( 19,
'ZHETRD_HB2ST', jobz, n, kd, ib, -1 )
286 lwtrd = ilaenv( 20,
'ZHETRD_HB2ST', jobz, n, kd, ib, -1 )
287 lwmin = lhtrd + lwtrd
291 IF( lwork.LT.lwmin .AND. .NOT.lquery )
296 CALL xerbla(
'ZHBEV_2STAGE ', -info )
298 ELSE IF( lquery )
THEN
309 w( 1 ) = dble( ab( 1, 1 ) )
311 w( 1 ) = dble( ab( kd+1, 1 ) )
320 safmin = dlamch(
'Safe minimum' )
321 eps = dlamch(
'Precision' )
322 smlnum = safmin / eps
323 bignum = one / smlnum
324 rmin = sqrt( smlnum )
325 rmax = sqrt( bignum )
329 anrm = zlanhb(
'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 zlascl(
'B', kd, kd, one, sigma, n, n, ab, ldab, info )
342 CALL zlascl(
'Q', kd, kd, one, sigma, n, n, ab, ldab, info )
350 indwrk = indhous + lhtrd
351 llwork = lwork - indwrk + 1
353 CALL zhetrd_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 dsterf( n, w, rwork( inde ), info )
363 CALL zsteqr( jobz, n, w, rwork( inde ), z, ldz,
364 $ rwork( indrwk ), info )
369 IF( iscale.EQ.1 )
THEN
375 CALL dscal( imax, one / sigma, w, 1 )
subroutine zhetrd_2stage(VECT, UPLO, N, A, LDA, D, E, TAU, HOUS2, LHOUS2, WORK, LWORK, INFO)
ZHETRD_2STAGE
subroutine zlascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
ZLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine dsterf(N, D, E, INFO)
DSTERF
subroutine zsteqr(COMPZ, N, D, E, Z, LDZ, WORK, INFO)
ZSTEQR
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine dscal(N, DA, DX, INCX)
DSCAL
subroutine zhbev_2stage(JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK, LWORK, RWORK, INFO)
ZHBEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER ...