248 SUBROUTINE ctrsna( JOB, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR,
249 $ ldvr, s, sep, mm, m, work, ldwork, rwork,
258 CHARACTER HOWMNY, JOB
259 INTEGER INFO, LDT, LDVL, LDVR, LDWORK, M, MM, N
263 REAL RWORK( * ), S( * ), SEP( * )
264 COMPLEX T( ldt, * ), VL( ldvl, * ), VR( ldvr, * ),
272 parameter ( zero = 0.0e+0, one = 1.0+0 )
275 LOGICAL SOMCON, WANTBH, WANTS, WANTSP
277 INTEGER I, IERR, IX, J, K, KASE, KS
278 REAL BIGNUM, EPS, EST, LNRM, RNRM, SCALE, SMLNUM,
291 EXTERNAL lsame, icamax, scnrm2, slamch, cdotc
298 INTRINSIC abs, aimag, max, real
304 cabs1( cdum ) = abs(
REAL( CDUM ) ) + abs( AIMAG( cdum ) )
310 wantbh = lsame( job,
'B' )
311 wants = lsame( job,
'E' ) .OR. wantbh
312 wantsp = lsame( job,
'V' ) .OR. wantbh
314 somcon = lsame( howmny,
'S' )
330 IF( .NOT.wants .AND. .NOT.wantsp )
THEN
332 ELSE IF( .NOT.lsame( howmny,
'A' ) .AND. .NOT.somcon )
THEN
334 ELSE IF( n.LT.0 )
THEN
336 ELSE IF( ldt.LT.max( 1, n ) )
THEN
338 ELSE IF( ldvl.LT.1 .OR. ( wants .AND. ldvl.LT.n ) )
THEN
340 ELSE IF( ldvr.LT.1 .OR. ( wants .AND. ldvr.LT.n ) )
THEN
342 ELSE IF( mm.LT.m )
THEN
344 ELSE IF( ldwork.LT.1 .OR. ( wantsp .AND. ldwork.LT.n ) )
THEN
348 CALL xerbla(
'CTRSNA', -info )
359 IF( .NOT.
SELECT( 1 ) )
365 $ sep( 1 ) = abs( t( 1, 1 ) )
372 smlnum = slamch(
'S' ) / eps
373 bignum = one / smlnum
374 CALL slabad( smlnum, bignum )
380 IF( .NOT.
SELECT( k ) )
389 prod = cdotc( n, vr( 1, ks ), 1, vl( 1, ks ), 1 )
390 rnrm = scnrm2( n, vr( 1, ks ), 1 )
391 lnrm = scnrm2( n, vl( 1, ks ), 1 )
392 s( ks ) = abs( prod ) / ( rnrm*lnrm )
404 CALL clacpy(
'Full', n, n, t, ldt, work, ldwork )
405 CALL ctrexc(
'No Q', n, work, ldwork, dummy, 1, k, 1, ierr )
410 work( i, i ) = work( i, i ) - work( 1, 1 )
421 CALL clacn2( n-1, work( 1, n+1 ), work, est, kase, isave )
428 CALL clatrs(
'Upper',
'Conjugate transpose',
429 $
'Nonunit', normin, n-1, work( 2, 2 ),
430 $ ldwork, work, scale, rwork, ierr )
435 CALL clatrs(
'Upper',
'No transpose',
'Nonunit',
436 $ normin, n-1, work( 2, 2 ), ldwork, work,
437 $ scale, rwork, ierr )
440 IF( scale.NE.one )
THEN
445 ix = icamax( n-1, work, 1 )
446 xnorm = cabs1( work( ix, 1 ) )
447 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
449 CALL csrscl( n, scale, work, 1 )
454 sep( ks ) = one / max( est, smlnum )
subroutine slabad(SMALL, LARGE)
SLABAD
subroutine clatrs(UPLO, TRANS, DIAG, NORMIN, N, A, LDA, X, SCALE, CNORM, INFO)
CLATRS solves a triangular system of equations with the scale factor set to prevent overflow...
subroutine ctrsna(JOB, HOWMNY, SELECT, N, T, LDT, VL, LDVL, VR, LDVR, S, SEP, MM, M, WORK, LDWORK, RWORK, INFO)
CTRSNA
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine csrscl(N, SA, SX, INCX)
CSRSCL multiplies a vector by the reciprocal of a real scalar.
subroutine clacpy(UPLO, M, N, A, LDA, B, LDB)
CLACPY copies all or part of one two-dimensional array to another.
subroutine ctrexc(COMPQ, N, T, LDT, Q, LDQ, IFST, ILST, INFO)
CTREXC
subroutine clacn2(N, V, X, EST, KASE, ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...