100 SUBROUTINE slagsy( N, K, D, A, LDA, ISEED, WORK, INFO )
107 INTEGER INFO, K, LDA, N
111 REAL A( LDA, * ), D( * ), WORK( * )
118 parameter( zero = 0.0e+0, one = 1.0e+0, half = 0.5e+0 )
122 REAL ALPHA, TAU, WA, WB, WN
142 ELSE IF( k.LT.0 .OR. k.GT.n-1 )
THEN
144 ELSE IF( lda.LT.max( 1, n ) )
THEN
148 CALL xerbla(
'SLAGSY', -info )
165 DO 40 i = n - 1, 1, -1
169 CALL slarnv( 3, iseed, n-i+1, work )
170 wn = snrm2( n-i+1, work, 1 )
171 wa = sign( wn, work( 1 ) )
172 IF( wn.EQ.zero )
THEN
176 CALL sscal( n-i, one / wb, work( 2 ), 1 )
186 CALL ssymv(
'Lower', n-i+1, tau, a( i, i ), lda, work, 1, zero,
191 alpha = -half*tau*sdot( n-i+1, work( n+1 ), 1, work, 1 )
192 CALL saxpy( n-i+1, alpha, work, 1, work( n+1 ), 1 )
196 CALL ssyr2(
'Lower', n-i+1, -one, work, 1, work( n+1 ), 1,
202 DO 60 i = 1, n - 1 - k
206 wn = snrm2( n-k-i+1, a( k+i, i ), 1 )
207 wa = sign( wn, a( k+i, i ) )
208 IF( wn.EQ.zero )
THEN
211 wb = a( k+i, i ) + wa
212 CALL sscal( n-k-i, one / wb, a( k+i+1, i ), 1 )
219 CALL sgemv(
'Transpose', n-k-i+1, k-1, one, a( k+i, i+1 ), lda,
220 $ a( k+i, i ), 1, zero, work, 1 )
221 CALL sger( n-k-i+1, k-1, -tau, a( k+i, i ), 1, work, 1,
222 $ a( k+i, i+1 ), lda )
228 CALL ssymv(
'Lower', n-k-i+1, tau, a( k+i, k+i ), lda,
229 $ a( k+i, i ), 1, zero, work, 1 )
233 alpha = -half*tau*sdot( n-k-i+1, work, 1, a( k+i, i ), 1 )
234 CALL saxpy( n-k-i+1, alpha, a( k+i, i ), 1, work, 1 )
238 CALL ssyr2(
'Lower', n-k-i+1, -one, a( k+i, i ), 1, work, 1,
239 $ a( k+i, k+i ), lda )
242 DO 50 j = k + i + 1, n
251 a( j, i ) = a( i, j )
subroutine xerbla(srname, info)
subroutine saxpy(n, sa, sx, incx, sy, incy)
SAXPY
subroutine sgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
SGEMV
subroutine sger(m, n, alpha, x, incx, y, incy, a, lda)
SGER
subroutine ssymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
SSYMV
subroutine ssyr2(uplo, n, alpha, x, incx, y, incy, a, lda)
SSYR2
subroutine slarnv(idist, iseed, n, x)
SLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine slagsy(n, k, d, a, lda, iseed, work, info)
SLAGSY