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
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 )