124 SUBROUTINE sbdt05( M, N, A, LDA, S, NS, U, LDU,
125 $ vt, ldvt, work, resid )
134 INTEGER LDA, LDU, LDVT, M, N, NS
138 REAL A( lda, * ), S( * ), U( ldu, * ),
139 $ vt( ldvt, * ), work( * )
146 parameter ( zero = 0.0e+0, one = 1.0e+0 )
155 REAL SASUM, SLAMCH, SLANGE
156 EXTERNAL lsame, isamax, sasum, slamch, slange
162 INTRINSIC abs,
REAL, MAX, MIN
169 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
172 eps = slamch(
'Precision' )
173 anorm = slange(
'M', m, n, a, lda, work )
177 CALL sgemm(
'N',
'T', m, ns, n, one, a, lda, vt,
178 $ ldvt, zero, work( 1+ns*ns ), m )
179 CALL sgemm(
'T',
'N', ns, ns, m, -one, u, ldu, work( 1+ns*ns ),
180 $ m, zero, work, ns )
186 work( j+i ) = work( j+i ) + s( i )
187 resid = max( resid, sasum( ns, work( j+1 ), 1 ) )
191 IF( anorm.LE.zero )
THEN
195 IF( anorm.GE.resid )
THEN
196 resid = ( resid / anorm ) / (
REAL( n )*EPS )
198 IF( anorm.LT.one )
THEN
199 resid = ( min( resid,
REAL( n )*ANORM ) / anorm ) /
202 resid = min( resid / anorm,
REAL( N ) ) /
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
subroutine sbdt05(M, N, A, LDA, S, NS, U, LDU, VT, LDVT, WORK, RESID)