131 SUBROUTINE sqrt16( TRANS, M, N, NRHS, A, LDA, X, LDX, B, LDB,
140 INTEGER LDA, LDB, LDX, M, N, NRHS
144 REAL A( LDA, * ), B( LDB, * ), RWORK( * ),
152 parameter( zero = 0.0e+0, one = 1.0e+0 )
156 REAL ANORM, BNORM, EPS, XNORM
160 REAL SASUM, SLAMCH, SLANGE
161 EXTERNAL lsame, sasum, slamch, slange
173 IF( m.LE.0 .OR. n.LE.0 .OR. nrhs.EQ.0 )
THEN
178 IF( lsame( trans,
'T' ) .OR. lsame( trans,
'C' ) )
THEN
179 anorm = slange(
'I', m, n, a, lda, rwork )
183 anorm = slange(
'1', m, n, a, lda, rwork )
188 eps = slamch(
'Epsilon' )
192 CALL sgemm( trans,
'No transpose', n1, nrhs, n2, -one, a, lda, x,
200 bnorm = sasum( n1, b( 1, j ), 1 )
201 xnorm = sasum( n2, x( 1, j ), 1 )
202 IF( anorm.EQ.zero .AND. bnorm.EQ.zero )
THEN
204 ELSE IF( anorm.LE.zero .OR. xnorm.LE.zero )
THEN
207 resid = max( resid, ( ( bnorm / anorm ) / xnorm ) /
208 $ ( max( m, n )*eps ) )
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sqrt16(trans, m, n, nrhs, a, lda, x, ldx, b, ldb, rwork, resid)
SQRT16