132 SUBROUTINE spst01( UPLO, N, A, LDA, AFAC, LDAFAC, PERM, LDPERM,
133 $ PIV, RWORK, RESID, RANK )
141 INTEGER LDA, LDAFAC, LDPERM, N, RANK
145 REAL A( LDA, * ), AFAC( LDAFAC, * ),
146 $ perm( ldperm, * ), rwork( * )
154 parameter( zero = 0.0e+0, one = 1.0e+0 )
161 REAL SDOT, SLAMCH, SLANSY
163 EXTERNAL sdot, slamch, slansy, lsame
182 eps = slamch(
'Epsilon' )
183 anorm = slansy(
'1', uplo, n, a, lda, rwork )
184 IF( anorm.LE.zero )
THEN
191 IF( lsame( uplo,
'U' ) )
THEN
194 DO 110 j = rank + 1, n
195 DO 100 i = rank + 1, j
205 t = sdot( k, afac( 1, k ), 1, afac( 1, k ), 1 )
210 CALL strmv(
'Upper',
'Transpose',
'Non-unit', k-1, afac,
211 $ ldafac, afac( 1, k ), 1 )
220 DO 140 j = rank + 1, n
232 $
CALL ssyr(
'Lower', n-k, one, afac( k+1, k ), 1,
233 $ afac( k+1, k+1 ), ldafac )
238 CALL sscal( n-k+1, t, afac( k, k ), 1 )
245 IF( lsame( uplo,
'U' ) )
THEN
249 IF( piv( i ).LE.piv( j ) )
THEN
251 perm( piv( i ), piv( j ) ) = afac( i, j )
253 perm( piv( i ), piv( j ) ) = afac( j, i )
264 IF( piv( i ).GE.piv( j ) )
THEN
266 perm( piv( i ), piv( j ) ) = afac( i, j )
268 perm( piv( i ), piv( j ) ) = afac( j, i )
278 IF( lsame( uplo,
'U' ) )
THEN
281 perm( i, j ) = perm( i, j ) - a( i, j )
287 perm( i, j ) = perm( i, j ) - a( i, j )
295 resid = slansy(
'1', uplo, n, perm, ldafac, rwork )
297 resid = ( ( resid / real( n ) ) / anorm ) / eps
subroutine ssyr(uplo, n, alpha, x, incx, a, lda)
SSYR
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine strmv(uplo, trans, diag, n, a, lda, x, incx)
STRMV
subroutine spst01(uplo, n, a, lda, afac, ldafac, perm, ldperm, piv, rwork, resid, rank)
SPST01