244 SUBROUTINE ctrsna( JOB, HOWMNY, SELECT, N, T, LDT, VL, LDVL,
246 $ LDVR, S, SEP, MM, M, WORK, LDWORK, RWORK,
254 CHARACTER HOWMNY, JOB
255 INTEGER INFO, LDT, LDVL, LDVR, LDWORK, M, MM, N
259 REAL RWORK( * ), S( * ), SEP( * )
260 COMPLEX T( LDT, * ), VL( LDVL, * ), VR( LDVR, * ),
268 PARAMETER ( ZERO = 0.0e+0, one = 1.0+0 )
271 LOGICAL SOMCON, WANTBH, WANTS, WANTSP
273 INTEGER I, IERR, IX, J, K, KASE, KS
274 REAL BIGNUM, EPS, EST, LNRM, RNRM, SCALE, SMLNUM,
287 EXTERNAL lsame, icamax, scnrm2, slamch,
295 INTRINSIC abs, aimag, max, real
301 cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
307 wantbh = lsame( job,
'B' )
308 wants = lsame( job,
'E' ) .OR. wantbh
309 wantsp = lsame( job,
'V' ) .OR. wantbh
311 somcon = lsame( howmny,
'S' )
327 IF( .NOT.wants .AND. .NOT.wantsp )
THEN
329 ELSE IF( .NOT.lsame( howmny,
'A' ) .AND. .NOT.somcon )
THEN
331 ELSE IF( n.LT.0 )
THEN
333 ELSE IF( ldt.LT.max( 1, n ) )
THEN
335 ELSE IF( ldvl.LT.1 .OR. ( wants .AND. ldvl.LT.n ) )
THEN
337 ELSE IF( ldvr.LT.1 .OR. ( wants .AND. ldvr.LT.n ) )
THEN
339 ELSE IF( mm.LT.m )
THEN
341 ELSE IF( ldwork.LT.1 .OR. ( wantsp .AND. ldwork.LT.n ) )
THEN
345 CALL xerbla(
'CTRSNA', -info )
356 IF( .NOT.
SELECT( 1 ) )
362 $ sep( 1 ) = abs( t( 1, 1 ) )
369 smlnum = slamch(
'S' ) / eps
370 bignum = one / smlnum
376 IF( .NOT.
SELECT( k ) )
385 prod = cdotc( n, vr( 1, ks ), 1, vl( 1, ks ), 1 )
386 rnrm = scnrm2( n, vr( 1, ks ), 1 )
387 lnrm = scnrm2( n, vl( 1, ks ), 1 )
388 s( ks ) = abs( prod ) / ( rnrm*lnrm )
400 CALL clacpy(
'Full', n, n, t, ldt, work, ldwork )
401 CALL ctrexc(
'No Q', n, work, ldwork, dummy, 1, k, 1,
407 work( i, i ) = work( i, i ) - work( 1, 1 )
418 CALL clacn2( n-1, work( 1, n+1 ), work, est, kase,
426 CALL clatrs(
'Upper',
'Conjugate transpose',
427 $
'Nonunit', normin, n-1, work( 2, 2 ),
428 $ ldwork, work, scale, rwork, ierr )
433 CALL clatrs(
'Upper',
'No transpose',
'Nonunit',
434 $ normin, n-1, work( 2, 2 ), ldwork, work,
435 $ scale, rwork, ierr )
438 IF( scale.NE.one )
THEN
443 ix = icamax( n-1, work, 1 )
444 xnorm = cabs1( work( ix, 1 ) )
445 IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
447 CALL csrscl( n, scale, work, 1 )
452 sep( ks ) = one / max( est, smlnum )
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