101 SUBROUTINE zlagsy( N, K, D, A, LDA, ISEED, WORK, INFO )
108 INTEGER INFO, K, LDA, N
112 DOUBLE PRECISION D( * )
113 COMPLEX*16 A( LDA, * ), WORK( * )
119 COMPLEX*16 ZERO, ONE, HALF
120 parameter( zero = ( 0.0d+0, 0.0d+0 ),
121 $ one = ( 1.0d+0, 0.0d+0 ),
122 $ half = ( 0.5d+0, 0.0d+0 ) )
127 COMPLEX*16 ALPHA, TAU, WA, WB
134 DOUBLE PRECISION DZNRM2
136 EXTERNAL dznrm2, zdotc
139 INTRINSIC abs, dble, max
148 ELSE IF( k.LT.0 .OR. k.GT.n-1 )
THEN
150 ELSE IF( lda.LT.max( 1, n ) )
THEN
154 CALL xerbla(
'ZLAGSY', -info )
171 DO 60 i = n - 1, 1, -1
175 CALL zlarnv( 3, iseed, n-i+1, work )
176 wn = dznrm2( n-i+1, work, 1 )
177 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
178 IF( wn.EQ.zero )
THEN
182 CALL zscal( n-i, one / wb, work( 2 ), 1 )
184 tau = dble( wb / wa )
192 CALL zlacgv( n-i+1, work, 1 )
193 CALL zsymv(
'Lower', n-i+1, tau, a( i, i ), lda, work, 1, zero,
195 CALL zlacgv( n-i+1, work, 1 )
199 alpha = -half*tau*zdotc( n-i+1, work, 1, work( n+1 ), 1 )
200 CALL zaxpy( n-i+1, alpha, work, 1, work( n+1 ), 1 )
209 a( ii, jj ) = a( ii, jj ) -
210 $ work( ii-i+1 )*work( n+jj-i+1 ) -
211 $ work( n+ii-i+1 )*work( jj-i+1 )
218 DO 100 i = 1, n - 1 - k
222 wn = dznrm2( n-k-i+1, a( k+i, i ), 1 )
223 wa = ( wn / abs( a( k+i, i ) ) )*a( k+i, i )
224 IF( wn.EQ.zero )
THEN
227 wb = a( k+i, i ) + wa
228 CALL zscal( n-k-i, one / wb, a( k+i+1, i ), 1 )
230 tau = dble( wb / wa )
235 CALL zgemv(
'Conjugate transpose', n-k-i+1, k-1, one,
236 $ a( k+i, i+1 ), lda, a( k+i, i ), 1, zero, work, 1 )
237 CALL zgerc( n-k-i+1, k-1, -tau, a( k+i, i ), 1, work, 1,
238 $ a( k+i, i+1 ), lda )
244 CALL zlacgv( n-k-i+1, a( k+i, i ), 1 )
245 CALL zsymv(
'Lower', n-k-i+1, tau, a( k+i, k+i ), lda,
246 $ a( k+i, i ), 1, zero, work, 1 )
247 CALL zlacgv( n-k-i+1, a( k+i, i ), 1 )
251 alpha = -half*tau*zdotc( n-k-i+1, a( k+i, i ), 1, work, 1 )
252 CALL zaxpy( n-k-i+1, alpha, a( k+i, i ), 1, work, 1 )
261 a( ii, jj ) = a( ii, jj ) - a( ii, i )*work( jj-k-i+1 ) -
262 $ work( ii-k-i+1 )*a( jj, i )
267 DO 90 j = k + i + 1, n
276 a( j, i ) = a( i, j )
subroutine xerbla(srname, info)
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zgerc(m, n, alpha, x, incx, y, incy, a, lda)
ZGERC
subroutine zsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
ZSYMV computes a matrix-vector product for a complex symmetric matrix.
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
subroutine zlarnv(idist, iseed, n, x)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zlagsy(n, k, d, a, lda, iseed, work, info)
ZLAGSY