133 SUBROUTINE zbdt03( UPLO, N, KD, D, E, U, LDU, S, VT, LDVT, WORK,
142 INTEGER KD, LDU, LDVT, N
143 DOUBLE PRECISION RESID
146 DOUBLE PRECISION D( * ), E( * ), S( * )
147 COMPLEX*16 U( LDU, * ), VT( LDVT, * ), WORK( * )
153 DOUBLE PRECISION ZERO, ONE
154 parameter( zero = 0.0d+0, one = 1.0d+0 )
158 DOUBLE PRECISION BNORM, EPS
163 DOUBLE PRECISION DLAMCH, DZASUM
164 EXTERNAL lsame, idamax, dlamch, dzasum
170 INTRINSIC abs, dble, dcmplx, max, min
187 IF( lsame( uplo,
'U' ) )
THEN
193 work( n+i ) = s( i )*vt( i, j )
195 CALL zgemv(
'No transpose', n, n, -dcmplx( one ), u, ldu,
196 $ work( n+1 ), 1, dcmplx( zero ), work, 1 )
197 work( j ) = work( j ) + d( j )
199 work( j-1 ) = work( j-1 ) + e( j-1 )
200 bnorm = max( bnorm, abs( d( j ) )+abs( e( j-1 ) ) )
202 bnorm = max( bnorm, abs( d( j ) ) )
204 resid = max( resid, dzasum( n, work, 1 ) )
212 work( n+i ) = s( i )*vt( i, j )
214 CALL zgemv(
'No transpose', n, n, -dcmplx( one ), u, ldu,
215 $ work( n+1 ), 1, dcmplx( zero ), work, 1 )
216 work( j ) = work( j ) + d( j )
218 work( j+1 ) = work( j+1 ) + e( j )
219 bnorm = max( bnorm, abs( d( j ) )+abs( e( j ) ) )
221 bnorm = max( bnorm, abs( d( j ) ) )
223 resid = max( resid, dzasum( n, work, 1 ) )
232 work( n+i ) = s( i )*vt( i, j )
234 CALL zgemv(
'No transpose', n, n, -dcmplx( one ), u, ldu,
235 $ work( n+1 ), 1, dcmplx( zero ), work, 1 )
236 work( j ) = work( j ) + d( j )
237 resid = max( resid, dzasum( n, work, 1 ) )
239 j = idamax( n, d, 1 )
240 bnorm = abs( d( j ) )
245 eps = dlamch(
'Precision' )
247 IF( bnorm.LE.zero )
THEN
251 IF( bnorm.GE.resid )
THEN
252 resid = ( resid / bnorm ) / ( dble( n )*eps )
254 IF( bnorm.LT.one )
THEN
255 resid = ( min( resid, dble( n )*bnorm ) / bnorm ) /
258 resid = min( resid / bnorm, dble( n ) ) /
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zbdt03(uplo, n, kd, d, e, u, ldu, s, vt, ldvt, work, resid)
ZBDT03