129 SUBROUTINE sbdt04( UPLO, N, D, E, S, NS, U, LDU, VT, LDVT, WORK,
138 INTEGER LDU, LDVT, N, NS
142 REAL D( * ), E( * ), S( * ), U( LDU, * ),
143 $ vt( ldvt, * ), work( * )
150 parameter( zero = 0.0e+0, one = 1.0e+0 )
160 EXTERNAL lsame, isamax, sasum, slamch
166 INTRINSIC abs, real, max, min
173 IF( n.LE.0 .OR. ns.LE.0 )
176 eps = slamch(
'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 sgemm(
'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, sasum( ns, work( k+1 ), 1 ) )
230 IF( bnorm.LE.zero )
THEN
234 IF( bnorm.GE.resid )
THEN
235 resid = ( resid / bnorm ) / ( real( n )*eps )
237 IF( bnorm.LT.one )
THEN
238 resid = ( min( resid, real( n )*bnorm ) / bnorm ) /
241 resid = min( resid / bnorm, real( n ) ) /
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sbdt04(uplo, n, d, e, s, ns, u, ldu, vt, ldvt, work, resid)
SBDT04