123 SUBROUTINE zbdt05( M, N, A, LDA, S, NS, U, LDU,
124 $ VT, LDVT, WORK, RESID )
131 INTEGER LDA, LDU, LDVT, M, N, NS
132 DOUBLE PRECISION RESID
135 DOUBLE PRECISION S( * )
136 COMPLEX*16 A( LDA, * ), U( * ), VT( LDVT, * ), WORK( * )
142 DOUBLE PRECISION ZERO, ONE
143 parameter( zero = 0.0d+0, one = 1.0d+0 )
144 COMPLEX*16 CZERO, CONE
145 parameter( czero = ( 0.0d+0, 0.0d+0 ),
146 $ cone = ( 1.0d+0, 0.0d+0 ) )
150 DOUBLE PRECISION ANORM, EPS
153 DOUBLE PRECISION DUM( 1 )
158 DOUBLE PRECISION DASUM, DZASUM, DLAMCH, ZLANGE
159 EXTERNAL lsame, idamax, dasum, dzasum, dlamch, zlange
165 INTRINSIC abs, dble, max, min
172 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
175 eps = dlamch(
'Precision' )
176 anorm = zlange(
'M', m, n, a, lda, dum )
180 CALL zgemm(
'N',
'C', m, ns, n, cone, a, lda, vt,
181 $ ldvt, czero, work( 1+ns*ns ), m )
182 CALL zgemm(
'C',
'N', ns, ns, m, -cone, u, ldu, work( 1+ns*ns ),
183 $ m, czero, work, ns )
189 work( j+i ) = work( j+i ) + dcmplx( s( i ), zero )
190 resid = max( resid, dzasum( ns, work( j+1 ), 1 ) )
194 IF( anorm.LE.zero )
THEN
198 IF( anorm.GE.resid )
THEN
199 resid = ( resid / anorm ) / ( dble( n )*eps )
201 IF( anorm.LT.one )
THEN
202 resid = ( min( resid, dble( n )*anorm ) / anorm ) /
205 resid = min( resid / anorm, dble( n ) ) /
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zbdt05(m, n, a, lda, s, ns, u, ldu, vt, ldvt, work, resid)
ZBDT05