161 SUBROUTINE zhbtrd( VECT, UPLO, N, KD, AB, LDAB, D, E, Q, LDQ,
170 INTEGER INFO, KD, LDAB, LDQ, N
173 DOUBLE PRECISION D( * ), E( * )
174 COMPLEX*16 AB( LDAB, * ), Q( LDQ, * ), WORK( * )
180 DOUBLE PRECISION ZERO
181 parameter( zero = 0.0d+0 )
182 COMPLEX*16 CZERO, CONE
183 parameter( czero = ( 0.0d+0, 0.0d+0 ),
184 $ cone = ( 1.0d+0, 0.0d+0 ) )
187 LOGICAL INITQ, UPPER, WANTQ
188 INTEGER I, I2, IBL, INCA, INCX, IQAEND, IQB, IQEND, J,
189 $ j1, j1end, j1inc, j2, jend, jin, jinc, k, kd1,
190 $ kdm1, kdn, l, last, lend, nq, nr, nrt
191 DOUBLE PRECISION ABST
199 INTRINSIC abs, dble, dconjg, max, min
209 initq = lsame( vect,
'V' )
210 wantq = initq .OR. lsame( vect,
'U' )
211 upper = lsame( uplo,
'U' )
218 IF( .NOT.wantq .AND. .NOT.lsame( vect,
'N' ) )
THEN
220 ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
222 ELSE IF( n.LT.0 )
THEN
224 ELSE IF( kd.LT.0 )
THEN
226 ELSE IF( ldab.LT.kd1 )
THEN
228 ELSE IF( ldq.LT.max( 1, n ) .AND. wantq )
THEN
232 CALL xerbla(
'ZHBTRD', -info )
244 $
CALL zlaset(
'Full', n, n, czero, cone, q, ldq )
265 ab( kd1, 1 ) = dble( ab( kd1, 1 ) )
270 DO 80 k = kdn + 1, 2, -1
279 CALL zlargv( nr, ab( 1, j1-1 ), inca, work( j1 ),
280 $ kd1, d( j1 ), kd1 )
288 IF( nr.GE.2*kd-1 )
THEN
290 CALL zlartv( nr, ab( l+1, j1-1 ), inca,
291 $ ab( l, j1 ), inca, d( j1 ),
296 jend = j1 + ( nr-1 )*kd1
297 DO 20 jinc = j1, jend, kd1
298 CALL zrot( kdm1, ab( 2, jinc-1 ), 1,
299 $ ab( 1, jinc ), 1, d( jinc ),
307 IF( k.LE.n-i+1 )
THEN
312 CALL zlartg( ab( kd-k+3, i+k-2 ),
313 $ ab( kd-k+2, i+k-1 ), d( i+k-1 ),
314 $ work( i+k-1 ), temp )
315 ab( kd-k+3, i+k-2 ) = temp
319 CALL zrot( k-3, ab( kd-k+4, i+k-2 ), 1,
320 $ ab( kd-k+3, i+k-1 ), 1, d( i+k-1 ),
331 $
CALL zlar2v( nr, ab( kd1, j1-1 ), ab( kd1, j1 ),
332 $ ab( kd, j1 ), inca, d( j1 ),
338 CALL zlacgv( nr, work( j1 ), kd1 )
339 IF( 2*kd-1.LT.nr )
THEN
351 $
CALL zlartv( nrt, ab( kd-l, j1+l ), inca,
352 $ ab( kd-l+1, j1+l ), inca,
353 $ d( j1 ), work( j1 ), kd1 )
356 j1end = j1 + kd1*( nr-2 )
357 IF( j1end.GE.j1 )
THEN
358 DO 40 jin = j1, j1end, kd1
359 CALL zrot( kd-1, ab( kd-1, jin+1 ), incx,
360 $ ab( kd, jin+1 ), incx,
361 $ d( jin ), work( jin ) )
364 lend = min( kdm1, n-j2 )
367 $
CALL zrot( lend, ab( kd-1, last+1 ), incx,
368 $ ab( kd, last+1 ), incx, d( last ),
382 iqend = max( iqend, j2 )
386 $ iqaend = iqaend + kd
387 iqaend = min( iqaend, iqend )
388 DO 50 j = j1, j2, kd1
391 iqb = max( 1, j-ibl )
392 nq = 1 + iqaend - iqb
393 iqaend = min( iqaend+kd, iqend )
394 CALL zrot( nq, q( iqb, j-1 ), 1, q( iqb, j ),
395 $ 1, d( j ), dconjg( work( j ) ) )
399 DO 60 j = j1, j2, kd1
400 CALL zrot( n, q( 1, j-1 ), 1, q( 1, j ), 1,
401 $ d( j ), dconjg( work( j ) ) )
407 IF( j2+kdn.GT.n )
THEN
415 DO 70 j = j1, j2, kd1
420 work( j+kd ) = work( j )*ab( 1, j+kd )
421 ab( 1, j+kd ) = d( j )*ab( 1, j+kd )
436 IF( abst.NE.zero )
THEN
442 $ ab( kd, i+2 ) = ab( kd, i+2 )*t
444 CALL zscal( n, dconjg( t ), q( 1, i+1 ), 1 )
459 d( i ) = dble( ab( kd1, i ) )
473 ab( 1, 1 ) = dble( ab( 1, 1 ) )
478 DO 200 k = kdn + 1, 2, -1
487 CALL zlargv( nr, ab( kd1, j1-kd1 ), inca,
488 $ work( j1 ), kd1, d( j1 ), kd1 )
496 IF( nr.GT.2*kd-1 )
THEN
498 CALL zlartv( nr, ab( kd1-l, j1-kd1+l ), inca,
499 $ ab( kd1-l+1, j1-kd1+l ), inca,
500 $ d( j1 ), work( j1 ), kd1 )
503 jend = j1 + kd1*( nr-1 )
504 DO 140 jinc = j1, jend, kd1
505 CALL zrot( kdm1, ab( kd, jinc-kd ), incx,
506 $ ab( kd1, jinc-kd ), incx,
507 $ d( jinc ), work( jinc ) )
514 IF( k.LE.n-i+1 )
THEN
519 CALL zlartg( ab( k-1, i ), ab( k, i ),
520 $ d( i+k-1 ), work( i+k-1 ), temp )
525 CALL zrot( k-3, ab( k-2, i+1 ), ldab-1,
526 $ ab( k-1, i+1 ), ldab-1, d( i+k-1 ),
537 $
CALL zlar2v( nr, ab( 1, j1-1 ), ab( 1, j1 ),
538 $ ab( 2, j1-1 ), inca, d( j1 ),
548 CALL zlacgv( nr, work( j1 ), kd1 )
549 IF( nr.GT.2*kd-1 )
THEN
557 $
CALL zlartv( nrt, ab( l+2, j1-1 ), inca,
558 $ ab( l+1, j1 ), inca, d( j1 ),
562 j1end = j1 + kd1*( nr-2 )
563 IF( j1end.GE.j1 )
THEN
564 DO 160 j1inc = j1, j1end, kd1
565 CALL zrot( kdm1, ab( 3, j1inc-1 ), 1,
566 $ ab( 2, j1inc ), 1, d( j1inc ),
570 lend = min( kdm1, n-j2 )
573 $
CALL zrot( lend, ab( 3, last-1 ), 1,
574 $ ab( 2, last ), 1, d( last ),
590 iqend = max( iqend, j2 )
594 $ iqaend = iqaend + kd
595 iqaend = min( iqaend, iqend )
596 DO 170 j = j1, j2, kd1
599 iqb = max( 1, j-ibl )
600 nq = 1 + iqaend - iqb
601 iqaend = min( iqaend+kd, iqend )
602 CALL zrot( nq, q( iqb, j-1 ), 1, q( iqb, j ),
603 $ 1, d( j ), work( j ) )
607 DO 180 j = j1, j2, kd1
608 CALL zrot( n, q( 1, j-1 ), 1, q( 1, j ), 1,
609 $ d( j ), work( j ) )
614 IF( j2+kdn.GT.n )
THEN
622 DO 190 j = j1, j2, kd1
627 work( j+kd ) = work( j )*ab( kd1, j )
628 ab( kd1, j ) = d( j )*ab( kd1, j )
643 IF( abst.NE.zero )
THEN
649 $ ab( 2, i+1 ) = ab( 2, i+1 )*t
651 CALL zscal( n, t, q( 1, i+1 ), 1 )
666 d( i ) = dble( ab( 1, i ) )
subroutine xerbla(srname, info)
subroutine zhbtrd(vect, uplo, n, kd, ab, ldab, d, e, q, ldq, work, info)
ZHBTRD
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
subroutine zlar2v(n, x, y, z, incx, c, s, incc)
ZLAR2V applies a vector of plane rotations with real cosines and complex sines from both sides to a s...
subroutine zlargv(n, x, incx, y, incy, c, incc)
ZLARGV generates a vector of plane rotations with real cosines and complex sines.
subroutine zlartg(f, g, c, s, r)
ZLARTG generates a plane rotation with real cosine and complex sine.
subroutine zlartv(n, x, incx, y, incy, c, s, incc)
ZLARTV applies a vector of plane rotations with real cosines and complex sines to the elements of a p...
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zrot(n, cx, incx, cy, incy, c, s)
ZROT applies a plane rotation with real cosine and complex sine to a pair of complex vectors.
subroutine zscal(n, za, zx, incx)
ZSCAL