123 SUBROUTINE cbdt05( M, N, A, LDA, S, NS, U, LDU,
124 $ vt, ldvt, work, resid )
133 INTEGER LDA, LDU, LDVT, M, N, NS
138 COMPLEX A( lda, * ), U( * ), VT( ldvt, * ), WORK( * )
145 parameter ( zero = 0.0e+0, one = 1.0e+0 )
147 parameter ( czero = ( 0.0e+0, 0.0e+0 ),
148 $ cone = ( 1.0e+0, 0.0e+0 ) )
160 REAL SASUM, SLAMCH, CLANGE
161 EXTERNAL lsame, isamax, sasum, slamch, clange
168 INTRINSIC abs,
REAL, MAX, MIN
175 IF( min( m, n ).LE.0 .OR. ns.LE.0 )
178 eps = slamch(
'Precision' )
179 anorm = clange(
'M', m, n, a, lda, dum )
183 CALL cgemm(
'N',
'C', m, ns, n, cone, a, lda, vt,
184 $ ldvt, czero, work( 1+ns*ns ), m )
185 CALL cgemm(
'C',
'N', ns, ns, m, -cone, u, ldu, work( 1+ns*ns ),
186 $ m, czero, work, ns )
192 work( j+i ) = work( j+i ) + cmplx( s( i ), zero )
193 resid = max( resid, scasum( ns, work( j+1 ), 1 ) )
197 IF( anorm.LE.zero )
THEN
201 IF( anorm.GE.resid )
THEN
202 resid = ( resid / anorm ) / (
REAL( n )*EPS )
204 IF( anorm.LT.one )
THEN
205 resid = ( min( resid,
REAL( n )*ANORM ) / anorm ) /
208 resid = min( resid / anorm,
REAL( N ) ) /
subroutine cgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
CGEMM
subroutine cbdt05(M, N, A, LDA, S, NS, U, LDU, VT, LDVT, WORK, RESID)