130 SUBROUTINE dbdt04( UPLO, N, D, E, S, NS, U, LDU, VT, LDVT, WORK,
140 INTEGER LDU, LDVT, N, NS
141 DOUBLE PRECISION RESID
144 DOUBLE PRECISION D( * ), E( * ), S( * ), U( ldu, * ),
145 $ vt( ldvt, * ), work( * )
151 DOUBLE PRECISION ZERO, ONE
152 parameter ( zero = 0.0d+0, one = 1.0d+0 )
156 DOUBLE PRECISION BNORM, EPS
161 DOUBLE PRECISION DASUM, DLAMCH
162 EXTERNAL lsame, idamax, dasum, dlamch
168 INTRINSIC abs, dble, max, min
175 IF( n.LE.0 .OR. ns.LE.0 )
178 eps = dlamch(
'Precision' )
184 IF( lsame( uplo,
'U' ) )
THEN
192 work( k ) = d( j )*vt( i, j ) + e( j )*vt( i, j+1 )
195 work( k ) = d( n )*vt( i, n )
197 bnorm = abs( d( 1 ) )
199 bnorm = max( bnorm, abs( d( i ) )+abs( e( i-1 ) ) )
208 work( k ) = d( 1 )*vt( i, 1 )
211 work( k ) = e( j )*vt( i, j ) + d( j+1 )*vt( i, j+1 )
214 bnorm = abs( d( n ) )
216 bnorm = max( bnorm, abs( d( i ) )+abs( e( i ) ) )
220 CALL dgemm(
'T',
'N', ns, ns, n, -one, u, ldu, work( 1 ),
221 $ n, zero, work( 1+n*ns ), ns )
227 work( k+i ) = work( k+i ) + s( i )
228 resid = max( resid, dasum( ns, work( k+1 ), 1 ) )
232 IF( bnorm.LE.zero )
THEN
236 IF( bnorm.GE.resid )
THEN
237 resid = ( resid / bnorm ) / ( dble( n )*eps )
239 IF( bnorm.LT.one )
THEN
240 resid = ( min( resid, dble( n )*bnorm ) / bnorm ) /
243 resid = min( resid / bnorm, dble( n ) ) /
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
DGEMM
subroutine dbdt04(UPLO, N, D, E, S, NS, U, LDU, VT, LDVT, WORK, RESID)