306 SUBROUTINE ztgsna( JOB, HOWMNY, SELECT, N, A, LDA, B, LDB, VL,
307 $ LDVL, VR, LDVR, S, DIF, MM, M, WORK, LWORK,
315 CHARACTER HOWMNY, JOB
316 INTEGER INFO, LDA, LDB, LDVL, LDVR, LWORK, M, MM, N
321 DOUBLE PRECISION DIF( * ), S( * )
322 COMPLEX*16 A( LDA, * ), B( LDB, * ), VL( LDVL, * ),
323 $ vr( ldvr, * ), work( * )
329 DOUBLE PRECISION ZERO, ONE
331 parameter( zero = 0.0d+0, one = 1.0d+0, idifjb = 3 )
334 LOGICAL LQUERY, SOMCON, WANTBH, WANTDF, WANTS
335 INTEGER I, IERR, IFST, ILST, K, KS, LWMIN, N1, N2
336 DOUBLE PRECISION BIGNUM, COND, EPS, LNRM, RNRM, SCALE, SMLNUM
337 COMPLEX*16 YHAX, YHBX
340 COMPLEX*16 DUMMY( 1 ), DUMMY1( 1 )
344 DOUBLE PRECISION DLAMCH, DLAPY2, DZNRM2
346 EXTERNAL lsame, dlamch, dlapy2, dznrm2,
354 INTRINSIC abs, dcmplx, max
360 wantbh = lsame( job,
'B' )
361 wants = lsame( job,
'E' ) .OR. wantbh
362 wantdf = lsame( job,
'V' ) .OR. wantbh
364 somcon = lsame( howmny,
'S' )
367 lquery = ( lwork.EQ.-1 )
369 IF( .NOT.wants .AND. .NOT.wantdf )
THEN
371 ELSE IF( .NOT.lsame( howmny,
'A' ) .AND. .NOT.somcon )
THEN
373 ELSE IF( n.LT.0 )
THEN
375 ELSE IF( lda.LT.max( 1, n ) )
THEN
377 ELSE IF( ldb.LT.max( 1, n ) )
THEN
379 ELSE IF( wants .AND. ldvl.LT.n )
THEN
381 ELSE IF( wants .AND. ldvr.LT.n )
THEN
400 ELSE IF( lsame( job,
'V' ) .OR. lsame( job,
'B' ) )
THEN
409 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery )
THEN
415 CALL xerbla(
'ZTGSNA', -info )
417 ELSE IF( lquery )
THEN
429 smlnum = dlamch(
'S' ) / eps
430 bignum = one / smlnum
438 IF( .NOT.
SELECT( k ) )
449 rnrm = dznrm2( n, vr( 1, ks ), 1 )
450 lnrm = dznrm2( n, vl( 1, ks ), 1 )
451 CALL zgemv(
'N', n, n, dcmplx( one, zero ), a, lda,
452 $ vr( 1, ks ), 1, dcmplx( zero, zero ), work, 1 )
453 yhax = zdotc( n, work, 1, vl( 1, ks ), 1 )
454 CALL zgemv(
'N', n, n, dcmplx( one, zero ), b, ldb,
455 $ vr( 1, ks ), 1, dcmplx( zero, zero ), work, 1 )
456 yhbx = zdotc( n, work, 1, vl( 1, ks ), 1 )
457 cond = dlapy2( abs( yhax ), abs( yhbx ) )
458 IF( cond.EQ.zero )
THEN
461 s( ks ) = cond / ( rnrm*lnrm )
467 dif( ks ) = dlapy2( abs( a( 1, 1 ) ), abs( b( 1,
477 CALL zlacpy(
'Full', n, n, a, lda, work, n )
478 CALL zlacpy(
'Full', n, n, b, ldb, work( n*n+1 ), n )
482 CALL ztgexc( .false., .false., n, work, n,
484 $ n, dummy, 1, dummy1, 1, ifst, ilst, ierr )
502 CALL ztgsyl(
'N', idifjb, n2, n1,
504 $ n, work, n, work( n1+1 ), n,
505 $ work( n*n1+n1+i ), n, work( i ), n,
506 $ work( n1+i ), n, scale, dif( ks ), dummy,
subroutine ztgsna(job, howmny, select, n, a, lda, b, ldb, vl, ldvl, vr, ldvr, s, dif, mm, m, work, lwork, iwork, info)
ZTGSNA
subroutine ztgsyl(trans, ijob, m, n, a, lda, b, ldb, c, ldc, d, ldd, e, lde, f, ldf, scale, dif, work, lwork, iwork, info)
ZTGSYL