123 SUBROUTINE zbdt05( M, N, A, LDA, S, NS, U, LDU,
124 $ vt, ldvt, work, resid )
133 INTEGER LDA, LDU, LDVT, M, N, NS
134 DOUBLE PRECISION RESID
137 DOUBLE PRECISION S( * )
138 COMPLEX*16 A( lda, * ), U( * ), VT( ldvt, * ), WORK( * )
144 DOUBLE PRECISION ZERO, ONE
145 parameter ( zero = 0.0d+0, one = 1.0d+0 )
146 COMPLEX*16 CZERO, CONE
147 parameter ( czero = ( 0.0d+0, 0.0d+0 ),
148 $ cone = ( 1.0d+0, 0.0d+0 ) )
152 DOUBLE PRECISION ANORM, EPS
155 DOUBLE PRECISION DUM( 1 )
160 DOUBLE PRECISION DASUM, DLAMCH, ZLANGE
161 EXTERNAL lsame, idamax, dasum, dlamch, zlange
162 DOUBLE PRECISION DZASUM
168 INTRINSIC abs, dble, max, min
175 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
178 eps = dlamch(
'Precision' )
179 anorm = zlange(
'M', m, n, a, lda, dum )
183 CALL zgemm(
'N',
'C', m, ns, n, cone, a, lda, vt,
184 $ ldvt, czero, work( 1+ns*ns ), m )
185 CALL zgemm(
'C',
'N', ns, ns, m, -cone, u, ldu, work( 1+ns*ns ),
186 $ m, czero, work, ns )
192 work( j+i ) = work( j+i ) + dcmplx( s( i ), zero )
193 resid = max( resid, dzasum( ns, work( j+1 ), 1 ) )
197 IF( anorm.LE.zero )
THEN
201 IF( anorm.GE.resid )
THEN
202 resid = ( resid / anorm ) / ( dble( n )*eps )
204 IF( anorm.LT.one )
THEN
205 resid = ( min( resid, dble( n )*anorm ) / anorm ) /
208 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)