102 SUBROUTINE slagsy( N, K, D, A, LDA, ISEED, WORK, INFO )
110 INTEGER info, k, lda, n
114 REAL a( lda, * ), d( * ), work( * )
121 parameter( zero = 0.0e+0, one = 1.0e+0, half = 0.5e+0 )
125 REAL alpha, tau, wa, wb, wn
145 ELSE IF( k.LT.0 .OR. k.GT.n-1 )
THEN
147 ELSE IF( lda.LT.max( 1, n ) )
THEN
151 CALL
xerbla(
'SLAGSY', -info )
168 DO 40 i = n - 1, 1, -1
172 CALL
slarnv( 3, iseed, n-i+1, work )
173 wn =
snrm2( n-i+1, work, 1 )
174 wa = sign( wn, work( 1 ) )
175 IF( wn.EQ.zero )
THEN
179 CALL
sscal( n-i, one / wb, work( 2 ), 1 )
189 CALL
ssymv(
'Lower', n-i+1, tau, a( i, i ), lda, work, 1, zero,
194 alpha = -half*tau*
sdot( n-i+1, work( n+1 ), 1, work, 1 )
195 CALL
saxpy( n-i+1, alpha, work, 1, work( n+1 ), 1 )
199 CALL
ssyr2(
'Lower', n-i+1, -one, work, 1, work( n+1 ), 1,
205 DO 60 i = 1, n - 1 - k
209 wn =
snrm2( n-k-i+1, a( k+i, i ), 1 )
210 wa = sign( wn, a( k+i, i ) )
211 IF( wn.EQ.zero )
THEN
214 wb = a( k+i, i ) + wa
215 CALL
sscal( n-k-i, one / wb, a( k+i+1, i ), 1 )
222 CALL
sgemv(
'Transpose', n-k-i+1, k-1, one, a( k+i, i+1 ), lda,
223 $ a( k+i, i ), 1, zero, work, 1 )
224 CALL
sger( n-k-i+1, k-1, -tau, a( k+i, i ), 1, work, 1,
225 $ a( k+i, i+1 ), lda )
231 CALL
ssymv(
'Lower', n-k-i+1, tau, a( k+i, k+i ), lda,
232 $ a( k+i, i ), 1, zero, work, 1 )
236 alpha = -half*tau*
sdot( n-k-i+1, work, 1, a( k+i, i ), 1 )
237 CALL
saxpy( n-k-i+1, alpha, a( k+i, i ), 1, work, 1 )
241 CALL
ssyr2(
'Lower', n-k-i+1, -one, a( k+i, i ), 1, work, 1,
242 $ a( k+i, k+i ), lda )
245 DO 50 j = k + i + 1, n
254 a( j, i ) = a( i, j )