119 SUBROUTINE zbdt02( M, N, B, LDB, C, LDC, U, LDU, WORK, RWORK,
128 INTEGER ldb, ldc, ldu, m, n
129 DOUBLE PRECISION resid
132 DOUBLE PRECISION rwork( * )
133 COMPLEX*16 b( ldb, * ), c( ldc, * ), u( ldu, * ),
140 DOUBLE PRECISION zero, one
141 parameter( zero = 0.0d+0, one = 1.0d+0 )
145 DOUBLE PRECISION bnorm, eps, realmn
155 INTRINSIC dble, dcmplx, max, min
162 IF( m.LE.0 .OR. n.LE.0 )
164 realmn = dble( max( m, n ) )
165 eps =
dlamch(
'Precision' )
170 CALL
zcopy( m, b( 1, j ), 1, work, 1 )
171 CALL
zgemv(
'No transpose', m, m, -dcmplx( one ), u, ldu,
172 $ c( 1, j ), 1, dcmplx( one ), work, 1 )
173 resid = max( resid,
dzasum( m, work, 1 ) )
178 bnorm =
zlange(
'1', m, n, b, ldb, rwork )
180 IF( bnorm.LE.zero )
THEN
184 IF( bnorm.GE.resid )
THEN
185 resid = ( resid / bnorm ) / ( realmn*eps )
187 IF( bnorm.LT.one )
THEN
188 resid = ( min( resid, realmn*bnorm ) / bnorm ) /
191 resid = min( resid / bnorm, realmn ) / ( realmn*eps )