129 SUBROUTINE dbdt04( UPLO, N, D, E, S, NS, U, LDU, VT, LDVT, WORK,
138 INTEGER LDU, LDVT, N, NS
139 DOUBLE PRECISION RESID
142 DOUBLE PRECISION D( * ), E( * ), S( * ), U( LDU, * ),
143 $ vt( ldvt, * ), work( * )
149 DOUBLE PRECISION ZERO, ONE
150 parameter( zero = 0.0d+0, one = 1.0d+0 )
154 DOUBLE PRECISION BNORM, EPS
159 DOUBLE PRECISION DASUM, DLAMCH
160 EXTERNAL lsame, idamax, dasum, dlamch
166 INTRINSIC abs, dble, max, min
173 IF( n.LE.0 .OR. ns.LE.0 )
176 eps = dlamch(
'Precision' )
182 IF( lsame( uplo,
'U' ) )
THEN
190 work( k ) = d( j )*vt( i, j ) + e( j )*vt( i, j+1 )
193 work( k ) = d( n )*vt( i, n )
195 bnorm = abs( d( 1 ) )
197 bnorm = max( bnorm, abs( d( i ) )+abs( e( i-1 ) ) )
206 work( k ) = d( 1 )*vt( i, 1 )
209 work( k ) = e( j )*vt( i, j ) + d( j+1 )*vt( i, j+1 )
212 bnorm = abs( d( n ) )
214 bnorm = max( bnorm, abs( d( i ) )+abs( e( i ) ) )
218 CALL dgemm(
'T',
'N', ns, ns, n, -one, u, ldu, work( 1 ),
219 $ n, zero, work( 1+n*ns ), ns )
225 work( k+i ) = work( k+i ) + s( i )
226 resid = max( resid, dasum( ns, work( k+1 ), 1 ) )
230 IF( bnorm.LE.zero )
THEN
234 IF( bnorm.GE.resid )
THEN
235 resid = ( resid / bnorm ) / ( dble( n )*eps )
237 IF( bnorm.LT.one )
THEN
238 resid = ( min( resid, dble( n )*bnorm ) / bnorm ) /
241 resid = min( resid / bnorm, dble( n ) ) /
subroutine dbdt04(uplo, n, d, e, s, ns, u, ldu, vt, ldvt, work, resid)
DBDT04
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM