134 SUBROUTINE spst01( UPLO, N, A, LDA, AFAC, LDAFAC, PERM, LDPERM,
135 $ piv, rwork, resid, rank )
144 INTEGER LDA, LDAFAC, LDPERM, N, RANK
148 REAL A( lda, * ), AFAC( ldafac, * ),
149 $ perm( ldperm, * ), rwork( * )
157 parameter ( zero = 0.0e+0, one = 1.0e+0 )
164 REAL SDOT, SLAMCH, SLANSY
166 EXTERNAL sdot, slamch, slansy, lsame
185 eps = slamch(
'Epsilon' )
186 anorm = slansy(
'1', uplo, n, a, lda, rwork )
187 IF( anorm.LE.zero )
THEN
194 IF( lsame( uplo,
'U' ) )
THEN
197 DO 110 j = rank + 1, n
198 DO 100 i = rank + 1, j
208 t = sdot( k, afac( 1, k ), 1, afac( 1, k ), 1 )
213 CALL strmv(
'Upper',
'Transpose',
'Non-unit', k-1, afac,
214 $ ldafac, afac( 1, k ), 1 )
223 DO 140 j = rank + 1, n
235 $
CALL ssyr(
'Lower', n-k, one, afac( k+1, k ), 1,
236 $ afac( k+1, k+1 ), ldafac )
241 CALL sscal( n-k+1, t, afac( k, k ), 1 )
248 IF( lsame( uplo,
'U' ) )
THEN
252 IF( piv( i ).LE.piv( j ) )
THEN
254 perm( piv( i ), piv( j ) ) = afac( i, j )
256 perm( piv( i ), piv( j ) ) = afac( j, i )
267 IF( piv( i ).GE.piv( j ) )
THEN
269 perm( piv( i ), piv( j ) ) = afac( i, j )
271 perm( piv( i ), piv( j ) ) = afac( j, i )
281 IF( lsame( uplo,
'U' ) )
THEN
284 perm( i, j ) = perm( i, j ) - a( i, j )
290 perm( i, j ) = perm( i, j ) - a( i, j )
298 resid = slansy(
'1', uplo, n, perm, ldafac, rwork )
300 resid = ( ( resid /
REAL( N ) ) / anorm ) / eps
subroutine spst01(UPLO, N, A, LDA, AFAC, LDAFAC, PERM, LDPERM, PIV, RWORK, RESID, RANK)
SPST01
subroutine strmv(UPLO, TRANS, DIAG, N, A, LDA, X, INCX)
STRMV
subroutine sscal(N, SA, SX, INCX)
SSCAL
subroutine ssyr(UPLO, N, ALPHA, X, INCX, A, LDA)
SSYR