125 SUBROUTINE dbdt05( M, N, A, LDA, S, NS, U, LDU,
126 $ VT, LDVT, WORK, RESID )
133 INTEGER LDA, LDU, LDVT, M, N, NS
134 DOUBLE PRECISION RESID
137 DOUBLE PRECISION A( LDA, * ), S( * ), U( LDU, * ),
138 $ vt( ldvt, * ), work( * )
144 DOUBLE PRECISION ZERO, ONE
145 parameter( zero = 0.0d+0, one = 1.0d+0 )
149 DOUBLE PRECISION ANORM, EPS
154 DOUBLE PRECISION DASUM, DLAMCH, DLANGE
155 EXTERNAL lsame, idamax, dasum, dlamch, dlange
161 INTRINSIC abs, dble, max, min
168 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
171 eps = dlamch(
'Precision' )
172 anorm = dlange(
'M', m, n, a, lda, work )
176 CALL dgemm(
'N',
'T', m, ns, n, one, a, lda, vt,
177 $ ldvt, zero, work( 1+ns*ns ), m )
178 CALL dgemm(
'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, dasum( ns, work( j+1 ), 1 ) )
190 IF( anorm.LE.zero )
THEN
194 IF( anorm.GE.resid )
THEN
195 resid = ( resid / anorm ) / ( dble( n )*eps )
197 IF( anorm.LT.one )
THEN
198 resid = ( min( resid, dble( n )*anorm ) / anorm ) /
201 resid = min( resid / anorm, dble( n ) ) /
subroutine dbdt05(m, n, a, lda, s, ns, u, ldu, vt, ldvt, work, resid)
DBDT05
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM