123 SUBROUTINE cbdt05( M, N, A, LDA, S, NS, U, LDU,
124 $ VT, LDVT, WORK, RESID )
131 INTEGER LDA, LDU, LDVT, M, N, NS
136 COMPLEX A( LDA, * ), U( * ), VT( LDVT, * ), WORK( * )
143 parameter( zero = 0.0e+0, one = 1.0e+0 )
145 parameter( czero = ( 0.0e+0, 0.0e+0 ),
146 $ cone = ( 1.0e+0, 0.0e+0 ) )
158 REAL SASUM, SCASUM, SLAMCH, CLANGE
159 EXTERNAL lsame, isamax, sasum, scasum, slamch, clange
165 INTRINSIC abs, real, max, min
172 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
175 eps = slamch(
'Precision' )
176 anorm = clange(
'M', m, n, a, lda, dum )
180 CALL cgemm(
'N',
'C', m, ns, n, cone, a, lda, vt,
181 $ ldvt, czero, work( 1+ns*ns ), m )
182 CALL cgemm(
'C',
'N', ns, ns, m, -cone, u, ldu, work( 1+ns*ns ),
183 $ m, czero, work, ns )
189 work( j+i ) = work( j+i ) + cmplx( s( i ), zero )
190 resid = max( resid, scasum( ns, work( j+1 ), 1 ) )
194 IF( anorm.LE.zero )
THEN
198 IF( anorm.GE.resid )
THEN
199 resid = ( resid / anorm ) / ( real( n )*eps )
201 IF( anorm.LT.one )
THEN
202 resid = ( min( resid, real( n )*anorm ) / anorm ) /
205 resid = min( resid / anorm, real( n ) ) /
subroutine cbdt05(m, n, a, lda, s, ns, u, ldu, vt, ldvt, work, resid)
CBDT05
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM