124 SUBROUTINE dbdt05( M, N, A, LDA, S, NS, U, LDU,
125 $ vt, ldvt, work, resid )
134 INTEGER LDA, LDU, LDVT, M, N, NS
135 DOUBLE PRECISION RESID
138 DOUBLE PRECISION A( lda, * ), S( * ), U( ldu, * ),
139 $ vt( ldvt, * ), work( * )
145 DOUBLE PRECISION ZERO, ONE
146 parameter ( zero = 0.0d+0, one = 1.0d+0 )
150 DOUBLE PRECISION ANORM, EPS
155 DOUBLE PRECISION DASUM, DLAMCH, DLANGE
156 EXTERNAL lsame, idamax, dasum, dlamch, dlange
162 INTRINSIC abs, dble, max, min
169 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
172 eps = dlamch(
'Precision' )
173 anorm = dlange(
'M', m, n, a, lda, work )
177 CALL dgemm(
'N',
'T', m, ns, n, one, a, lda, vt,
178 $ ldvt, zero, work( 1+ns*ns ), m )
179 CALL dgemm(
'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, dasum( ns, work( j+1 ), 1 ) )
191 IF( anorm.LE.zero )
THEN
195 IF( anorm.GE.resid )
THEN
196 resid = ( resid / anorm ) / ( dble( n )*eps )
198 IF( anorm.LT.one )
THEN
199 resid = ( min( resid, dble( n )*anorm ) / anorm ) /
202 resid = min( resid / anorm, dble( n ) ) /
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
subroutine dbdt05(M, N, A, LDA, S, NS, U, LDU, VT, LDVT, WORK, RESID)