125 SUBROUTINE sbdt05( M, N, A, LDA, S, NS, U, LDU,
126 $ VT, LDVT, WORK, RESID )
133 INTEGER LDA, LDU, LDVT, M, N, NS
137 REAL A( LDA, * ), S( * ), U( LDU, * ),
138 $ vt( ldvt, * ), work( * )
145 parameter( zero = 0.0e+0, one = 1.0e+0 )
154 REAL SASUM, SLAMCH, SLANGE
155 EXTERNAL lsame, isamax, sasum, slamch, slange
161 INTRINSIC abs, real, max, min
168 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
171 eps = slamch(
'Precision' )
172 anorm = slange(
'M', m, n, a, lda, work )
176 CALL sgemm(
'N',
'T', m, ns, n, one, a, lda, vt,
177 $ ldvt, zero, work( 1+ns*ns ), m )
178 CALL sgemm(
'T',
'N', ns, ns, m, -one, u, ldu, work( 1+ns*ns ),
179 $ m, zero, work, ns )
185 work( j+i ) = work( j+i ) + s( i )
186 resid = max( resid, sasum( ns, work( j+1 ), 1 ) )
190 IF( anorm.LE.zero )
THEN
194 IF( anorm.GE.resid )
THEN
195 resid = ( resid / anorm ) / ( real( n )*eps )
197 IF( anorm.LT.one )
THEN
198 resid = ( min( resid, real( n )*anorm ) / anorm ) /
201 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)
SBDT05