162 SUBROUTINE cunt03( RC, MU, MV, N, K, U, LDU, V, LDV, WORK, LWORK,
163 $ rwork, result, info )
172 INTEGER INFO, K, LDU, LDV, LWORK, MU, MV, N
177 COMPLEX U( ldu, * ), V( ldv, * ), WORK( * )
185 parameter ( zero = 0.0e0, one = 1.0e0 )
188 INTEGER I, IRC, J, LMX
196 EXTERNAL lsame, icamax, slamch
199 INTRINSIC abs, cmplx, max, min, real
209 IF( lsame( rc,
'R' ) )
THEN
211 ELSE IF( lsame( rc,
'C' ) )
THEN
218 ELSE IF( mu.LT.0 )
THEN
220 ELSE IF( mv.LT.0 )
THEN
222 ELSE IF( n.LT.0 )
THEN
224 ELSE IF( k.LT.0 .OR. k.GT.max( mu, mv ) )
THEN
226 ELSE IF( ( irc.EQ.0 .AND. ldu.LT.max( 1, mu ) ) .OR.
227 $ ( irc.EQ.1 .AND. ldu.LT.max( 1, n ) ) )
THEN
229 ELSE IF( ( irc.EQ.0 .AND. ldv.LT.max( 1, mv ) ) .OR.
230 $ ( irc.EQ.1 .AND. ldv.LT.max( 1, n ) ) )
THEN
234 CALL xerbla(
'CUNT03', -info )
241 IF( mu.EQ.0 .OR. mv.EQ.0 .OR. n.EQ.0 )
246 ulp = slamch(
'Precision' )
254 lmx = icamax( n, u( i, 1 ), ldu )
255 IF( v( i, lmx ).EQ.cmplx( zero ) )
THEN
258 sv = abs( v( i, lmx ) ) / v( i, lmx )
260 IF( u( i, lmx ).EQ.cmplx( zero ) )
THEN
263 su = abs( u( i, lmx ) ) / u( i, lmx )
267 res1 = max( res1, abs( u( i, j )-s*v( i, j ) ) )
270 res1 = res1 / (
REAL( n )*ULP )
274 CALL cunt01(
'Rows', mv, n, v, ldv, work, lwork, rwork, res2 )
282 lmx = icamax( n, u( 1, i ), 1 )
283 IF( v( lmx, i ).EQ.cmplx( zero ) )
THEN
286 sv = abs( v( lmx, i ) ) / v( lmx, i )
288 IF( u( lmx, i ).EQ.cmplx( zero ) )
THEN
291 su = abs( u( lmx, i ) ) / u( lmx, i )
295 res1 = max( res1, abs( u( j, i )-s*v( j, i ) ) )
298 res1 = res1 / (
REAL( n )*ULP )
302 CALL cunt01(
'Columns', n, mv, v, ldv, work, lwork, rwork,
306 result = min( max( res1, res2 ), one / ulp )
subroutine cunt03(RC, MU, MV, N, K, U, LDU, V, LDV, WORK, LWORK, RWORK, RESULT, INFO)
CUNT03
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine cunt01(ROWCOL, M, N, U, LDU, WORK, LWORK, RWORK, RESID)
CUNT01