113 SUBROUTINE ssytri( UPLO, N, A, LDA, IPIV, WORK, INFO )
125 REAL A( LDA, * ), WORK( * )
132 parameter( one = 1.0e+0, zero = 0.0e+0 )
137 REAL AK, AKKP1, AKP1, D, T, TEMP
155 upper = lsame( uplo,
'U' )
156 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
158 ELSE IF( n.LT.0 )
THEN
160 ELSE IF( lda.LT.max( 1, n ) )
THEN
164 CALL xerbla(
'SSYTRI', -info )
179 DO 10 info = n, 1, -1
180 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
188 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
209 IF( ipiv( k ).GT.0 )
THEN
215 a( k, k ) = one / a( k, k )
220 CALL scopy( k-1, a( 1, k ), 1, work, 1 )
221 CALL ssymv( uplo, k-1, -one, a, lda, work, 1, zero,
223 a( k, k ) = a( k, k ) - sdot( k-1, work, 1, a( 1, k ),
233 t = abs( a( k, k+1 ) )
235 akp1 = a( k+1, k+1 ) / t
236 akkp1 = a( k, k+1 ) / t
237 d = t*( ak*akp1-one )
239 a( k+1, k+1 ) = ak / d
240 a( k, k+1 ) = -akkp1 / d
245 CALL scopy( k-1, a( 1, k ), 1, work, 1 )
246 CALL ssymv( uplo, k-1, -one, a, lda, work, 1, zero,
248 a( k, k ) = a( k, k ) - sdot( k-1, work, 1, a( 1, k ),
250 a( k, k+1 ) = a( k, k+1 ) -
251 $ sdot( k-1, a( 1, k ), 1, a( 1, k+1 ), 1 )
252 CALL scopy( k-1, a( 1, k+1 ), 1, work, 1 )
253 CALL ssymv( uplo, k-1, -one, a, lda, work, 1, zero,
255 a( k+1, k+1 ) = a( k+1, k+1 ) -
256 $ sdot( k-1, work, 1, a( 1, k+1 ), 1 )
261 kp = abs( ipiv( k ) )
267 CALL sswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
268 CALL sswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
270 a( k, k ) = a( kp, kp )
272 IF( kstep.EQ.2 )
THEN
274 a( k, k+1 ) = a( kp, k+1 )
298 IF( ipiv( k ).GT.0 )
THEN
304 a( k, k ) = one / a( k, k )
309 CALL scopy( n-k, a( k+1, k ), 1, work, 1 )
310 CALL ssymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
311 $ zero, a( k+1, k ), 1 )
312 a( k, k ) = a( k, k ) - sdot( n-k, work, 1, a( k+1, k ),
322 t = abs( a( k, k-1 ) )
323 ak = a( k-1, k-1 ) / t
325 akkp1 = a( k, k-1 ) / t
326 d = t*( ak*akp1-one )
327 a( k-1, k-1 ) = akp1 / d
329 a( k, k-1 ) = -akkp1 / d
334 CALL scopy( n-k, a( k+1, k ), 1, work, 1 )
335 CALL ssymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
336 $ zero, a( k+1, k ), 1 )
337 a( k, k ) = a( k, k ) - sdot( n-k, work, 1, a( k+1, k ),
339 a( k, k-1 ) = a( k, k-1 ) -
340 $ sdot( n-k, a( k+1, k ), 1, a( k+1, k-1 ),
342 CALL scopy( n-k, a( k+1, k-1 ), 1, work, 1 )
343 CALL ssymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
344 $ zero, a( k+1, k-1 ), 1 )
345 a( k-1, k-1 ) = a( k-1, k-1 ) -
346 $ sdot( n-k, work, 1, a( k+1, k-1 ), 1 )
351 kp = abs( ipiv( k ) )
358 $
CALL sswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
359 CALL sswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
361 a( k, k ) = a( kp, kp )
363 IF( kstep.EQ.2 )
THEN
365 a( k, k-1 ) = a( kp, k-1 )
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine ssymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
SSYMV
subroutine ssytri(uplo, n, a, lda, ipiv, work, info)
SSYTRI
subroutine sswap(n, sx, incx, sy, incy)
SSWAP