130 SUBROUTINE sbdt04( UPLO, N, D, E, S, NS, U, LDU, VT, LDVT, WORK,
140 INTEGER LDU, LDVT, N, NS
144 REAL D( * ), E( * ), S( * ), U( ldu, * ),
145 $ vt( ldvt, * ), work( * )
152 parameter ( zero = 0.0e+0, one = 1.0e+0 )
162 EXTERNAL lsame, isamax, sasum, slamch
168 INTRINSIC abs,
REAL, MAX, MIN
175 IF( n.LE.0 .OR. ns.LE.0 )
178 eps = slamch(
'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 sgemm(
'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, sasum( ns, work( k+1 ), 1 ) )
232 IF( bnorm.LE.zero )
THEN
236 IF( bnorm.GE.resid )
THEN
237 resid = ( resid / bnorm ) / (
REAL( n )*EPS )
239 IF( bnorm.LT.one )
THEN
240 resid = ( min( resid,
REAL( n )*BNORM ) / bnorm ) /
243 resid = min( resid / bnorm,
REAL( N ) ) /
subroutine sbdt04(UPLO, N, D, E, S, NS, U, LDU, VT, LDVT, WORK, RESID)
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM