108 SUBROUTINE ssptri( UPLO, N, AP, IPIV, WORK, INFO )
120 REAL AP( * ), WORK( * )
127 parameter( one = 1.0e+0, zero = 0.0e+0 )
131 INTEGER J, K, KC, KCNEXT, KP, KPC, KSTEP, KX, NPP
132 REAL AK, AKKP1, AKP1, D, T, TEMP
150 upper = lsame( uplo,
'U' )
151 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
153 ELSE IF( n.LT.0 )
THEN
157 CALL xerbla(
'SSPTRI', -info )
173 DO 10 info = n, 1, -1
174 IF( ipiv( info ).GT.0 .AND. ap( kp ).EQ.zero )
184 IF( ipiv( info ).GT.0 .AND. ap( kp ).EQ.zero )
186 kp = kp + n - info + 1
208 IF( ipiv( k ).GT.0 )
THEN
214 ap( kc+k-1 ) = one / ap( kc+k-1 )
219 CALL scopy( k-1, ap( kc ), 1, work, 1 )
220 CALL sspmv( uplo, k-1, -one, ap, work, 1, zero, ap( kc ),
222 ap( kc+k-1 ) = ap( kc+k-1 ) -
223 $ sdot( k-1, work, 1, ap( kc ), 1 )
232 t = abs( ap( kcnext+k-1 ) )
233 ak = ap( kc+k-1 ) / t
234 akp1 = ap( kcnext+k ) / t
235 akkp1 = ap( kcnext+k-1 ) / t
236 d = t*( ak*akp1-one )
237 ap( kc+k-1 ) = akp1 / d
238 ap( kcnext+k ) = ak / d
239 ap( kcnext+k-1 ) = -akkp1 / d
244 CALL scopy( k-1, ap( kc ), 1, work, 1 )
245 CALL sspmv( uplo, k-1, -one, ap, work, 1, zero, ap( kc ),
247 ap( kc+k-1 ) = ap( kc+k-1 ) -
248 $ sdot( k-1, work, 1, ap( kc ), 1 )
249 ap( kcnext+k-1 ) = ap( kcnext+k-1 ) -
250 $ sdot( k-1, ap( kc ), 1, ap( kcnext ),
252 CALL scopy( k-1, ap( kcnext ), 1, work, 1 )
253 CALL sspmv( uplo, k-1, -one, ap, work, 1, zero,
255 ap( kcnext+k ) = ap( kcnext+k ) -
256 $ sdot( k-1, work, 1, ap( kcnext ), 1 )
259 kcnext = kcnext + k + 1
262 kp = abs( ipiv( k ) )
268 kpc = ( kp-1 )*kp / 2 + 1
269 CALL sswap( kp-1, ap( kc ), 1, ap( kpc ), 1 )
271 DO 40 j = kp + 1, k - 1
274 ap( kc+j-1 ) = ap( kx )
278 ap( kc+k-1 ) = ap( kpc+kp-1 )
279 ap( kpc+kp-1 ) = temp
280 IF( kstep.EQ.2 )
THEN
281 temp = ap( kc+k+k-1 )
282 ap( kc+k+k-1 ) = ap( kc+k+kp-1 )
283 ap( kc+k+kp-1 ) = temp
309 kcnext = kc - ( n-k+2 )
310 IF( ipiv( k ).GT.0 )
THEN
316 ap( kc ) = one / ap( kc )
321 CALL scopy( n-k, ap( kc+1 ), 1, work, 1 )
322 CALL sspmv( uplo, n-k, -one, ap( kc+n-k+1 ), work, 1,
323 $ zero, ap( kc+1 ), 1 )
324 ap( kc ) = ap( kc ) - sdot( n-k, work, 1, ap( kc+1 ), 1 )
333 t = abs( ap( kcnext+1 ) )
334 ak = ap( kcnext ) / t
336 akkp1 = ap( kcnext+1 ) / t
337 d = t*( ak*akp1-one )
338 ap( kcnext ) = akp1 / d
340 ap( kcnext+1 ) = -akkp1 / d
345 CALL scopy( n-k, ap( kc+1 ), 1, work, 1 )
346 CALL sspmv( uplo, n-k, -one, ap( kc+( n-k+1 ) ), work, 1,
347 $ zero, ap( kc+1 ), 1 )
348 ap( kc ) = ap( kc ) - sdot( n-k, work, 1, ap( kc+1 ), 1 )
349 ap( kcnext+1 ) = ap( kcnext+1 ) -
350 $ sdot( n-k, ap( kc+1 ), 1,
351 $ ap( kcnext+2 ), 1 )
352 CALL scopy( n-k, ap( kcnext+2 ), 1, work, 1 )
353 CALL sspmv( uplo, n-k, -one, ap( kc+( n-k+1 ) ), work, 1,
354 $ zero, ap( kcnext+2 ), 1 )
355 ap( kcnext ) = ap( kcnext ) -
356 $ sdot( n-k, work, 1, ap( kcnext+2 ), 1 )
359 kcnext = kcnext - ( n-k+3 )
362 kp = abs( ipiv( k ) )
368 kpc = npp - ( n-kp+1 )*( n-kp+2 ) / 2 + 1
370 $
CALL sswap( n-kp, ap( kc+kp-k+1 ), 1, ap( kpc+1 ), 1 )
372 DO 70 j = k + 1, kp - 1
375 ap( kc+j-k ) = ap( kx )
381 IF( kstep.EQ.2 )
THEN
382 temp = ap( kc-n+k-1 )
383 ap( kc-n+k-1 ) = ap( kc-n+kp-1 )
384 ap( kc-n+kp-1 ) = temp
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
SSPMV
subroutine ssptri(uplo, n, ap, ipiv, work, info)
SSPTRI
subroutine sswap(n, sx, incx, sy, incy)
SSWAP