101 SUBROUTINE clagsy( N, K, D, A, LDA, ISEED, WORK, INFO )
108 INTEGER INFO, K, LDA, N
113 COMPLEX A( LDA, * ), WORK( * )
119 COMPLEX ZERO, ONE, HALF
120 parameter( zero = ( 0.0e+0, 0.0e+0 ),
121 $ one = ( 1.0e+0, 0.0e+0 ),
122 $ half = ( 0.5e+0, 0.0e+0 ) )
127 COMPLEX ALPHA, TAU, WA, WB
136 EXTERNAL scnrm2, cdotc
139 INTRINSIC abs, max, real
148 ELSE IF( k.LT.0 .OR. k.GT.n-1 )
THEN
150 ELSE IF( lda.LT.max( 1, n ) )
THEN
154 CALL xerbla(
'CLAGSY', -info )
171 DO 60 i = n - 1, 1, -1
175 CALL clarnv( 3, iseed, n-i+1, work )
176 wn = scnrm2( n-i+1, work, 1 )
177 wa = ( wn / abs( work( 1 ) ) )*work( 1 )
178 IF( wn.EQ.zero )
THEN
182 CALL cscal( n-i, one / wb, work( 2 ), 1 )
184 tau = real( wb / wa )
192 CALL clacgv( n-i+1, work, 1 )
193 CALL csymv(
'Lower', n-i+1, tau, a( i, i ), lda, work, 1, zero,
195 CALL clacgv( n-i+1, work, 1 )
199 alpha = -half*tau*cdotc( n-i+1, work, 1, work( n+1 ), 1 )
200 CALL caxpy( 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 = scnrm2( 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 cscal( n-k-i, one / wb, a( k+i+1, i ), 1 )
230 tau = real( wb / wa )
235 CALL cgemv(
'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 cgerc( n-k-i+1, k-1, -tau, a( k+i, i ), 1, work, 1,
238 $ a( k+i, i+1 ), lda )
244 CALL clacgv( n-k-i+1, a( k+i, i ), 1 )
245 CALL csymv(
'Lower', n-k-i+1, tau, a( k+i, k+i ), lda,
246 $ a( k+i, i ), 1, zero, work, 1 )
247 CALL clacgv( n-k-i+1, a( k+i, i ), 1 )
251 alpha = -half*tau*cdotc( n-k-i+1, a( k+i, i ), 1, work, 1 )
252 CALL caxpy( 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 clagsy(n, k, d, a, lda, iseed, work, info)
CLAGSY
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cgerc(m, n, alpha, x, incx, y, incy, a, lda)
CGERC
subroutine csymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
CSYMV computes a matrix-vector product for a complex symmetric matrix.
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine clarnv(idist, iseed, n, x)
CLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine cscal(n, ca, cx, incx)
CSCAL