LAPACK  3.5.0
LAPACK: Linear Algebra PACKage
ztgsen.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine ztgsen (IJOB, WANTQ, WANTZ, SELECT, N, A, LDA, B, LDB, ALPHA, BETA, Q, LDQ, Z, LDZ, M, PL, PR, DIF, WORK, LWORK, IWORK, LIWORK, INFO)
 ZTGSEN More...
 

Function/Subroutine Documentation

subroutine ztgsen ( integer  IJOB,
logical  WANTQ,
logical  WANTZ,
logical, dimension( * )  SELECT,
integer  N,
complex*16, dimension( lda, * )  A,
integer  LDA,
complex*16, dimension( ldb, * )  B,
integer  LDB,
complex*16, dimension( * )  ALPHA,
complex*16, dimension( * )  BETA,
complex*16, dimension( ldq, * )  Q,
integer  LDQ,
complex*16, dimension( ldz, * )  Z,
integer  LDZ,
integer  M,
double precision  PL,
double precision  PR,
double precision, dimension( * )  DIF,
complex*16, dimension( * )  WORK,
integer  LWORK,
integer, dimension( * )  IWORK,
integer  LIWORK,
integer  INFO 
)

ZTGSEN

Download ZTGSEN + dependencies [TGZ] [ZIP] [TXT]

Purpose:
 ZTGSEN reorders the generalized Schur decomposition of a complex
 matrix pair (A, B) (in terms of an unitary equivalence trans-
 formation Q**H * (A, B) * Z), so that a selected cluster of eigenvalues
 appears in the leading diagonal blocks of the pair (A,B). The leading
 columns of Q and Z form unitary bases of the corresponding left and
 right eigenspaces (deflating subspaces). (A, B) must be in
 generalized Schur canonical form, that is, A and B are both upper
 triangular.

 ZTGSEN also computes the generalized eigenvalues

          w(j)= ALPHA(j) / BETA(j)

 of the reordered matrix pair (A, B).

 Optionally, the routine computes estimates of reciprocal condition
 numbers for eigenvalues and eigenspaces. These are Difu[(A11,B11),
 (A22,B22)] and Difl[(A11,B11), (A22,B22)], i.e. the separation(s)
 between the matrix pairs (A11, B11) and (A22,B22) that correspond to
 the selected cluster and the eigenvalues outside the cluster, resp.,
 and norms of "projections" onto left and right eigenspaces w.r.t.
 the selected cluster in the (1,1)-block.
Parameters
[in]IJOB
          IJOB is integer
          Specifies whether condition numbers are required for the
          cluster of eigenvalues (PL and PR) or the deflating subspaces
          (Difu and Difl):
           =0: Only reorder w.r.t. SELECT. No extras.
           =1: Reciprocal of norms of "projections" onto left and right
               eigenspaces w.r.t. the selected cluster (PL and PR).
           =2: Upper bounds on Difu and Difl. F-norm-based estimate
               (DIF(1:2)).
           =3: Estimate of Difu and Difl. 1-norm-based estimate
               (DIF(1:2)).
               About 5 times as expensive as IJOB = 2.
           =4: Compute PL, PR and DIF (i.e. 0, 1 and 2 above): Economic
               version to get it all.
           =5: Compute PL, PR and DIF (i.e. 0, 1 and 3 above)
[in]WANTQ
          WANTQ is LOGICAL
          .TRUE. : update the left transformation matrix Q;
          .FALSE.: do not update Q.
[in]WANTZ
          WANTZ is LOGICAL
          .TRUE. : update the right transformation matrix Z;
          .FALSE.: do not update Z.
[in]SELECT
          SELECT is LOGICAL array, dimension (N)
          SELECT specifies the eigenvalues in the selected cluster. To
          select an eigenvalue w(j), SELECT(j) must be set to
          .TRUE..
[in]N
          N is INTEGER
          The order of the matrices A and B. N >= 0.
[in,out]A
          A is COMPLEX*16 array, dimension(LDA,N)
          On entry, the upper triangular matrix A, in generalized
          Schur canonical form.
          On exit, A is overwritten by the reordered matrix A.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A. LDA >= max(1,N).
[in,out]B
          B is COMPLEX*16 array, dimension(LDB,N)
          On entry, the upper triangular matrix B, in generalized
          Schur canonical form.
          On exit, B is overwritten by the reordered matrix B.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B. LDB >= max(1,N).
[out]ALPHA
          ALPHA is COMPLEX*16 array, dimension (N)
[out]BETA
          BETA is COMPLEX*16 array, dimension (N)

          The diagonal elements of A and B, respectively,
          when the pair (A,B) has been reduced to generalized Schur
          form.  ALPHA(i)/BETA(i) i=1,...,N are the generalized
          eigenvalues.
[in,out]Q
          Q is COMPLEX*16 array, dimension (LDQ,N)
          On entry, if WANTQ = .TRUE., Q is an N-by-N matrix.
          On exit, Q has been postmultiplied by the left unitary
          transformation matrix which reorder (A, B); The leading M
          columns of Q form orthonormal bases for the specified pair of
          left eigenspaces (deflating subspaces).
          If WANTQ = .FALSE., Q is not referenced.
[in]LDQ
          LDQ is INTEGER
          The leading dimension of the array Q. LDQ >= 1.
          If WANTQ = .TRUE., LDQ >= N.
[in,out]Z
          Z is COMPLEX*16 array, dimension (LDZ,N)
          On entry, if WANTZ = .TRUE., Z is an N-by-N matrix.
          On exit, Z has been postmultiplied by the left unitary
          transformation matrix which reorder (A, B); The leading M
          columns of Z form orthonormal bases for the specified pair of
          left eigenspaces (deflating subspaces).
          If WANTZ = .FALSE., Z is not referenced.
[in]LDZ
          LDZ is INTEGER
          The leading dimension of the array Z. LDZ >= 1.
          If WANTZ = .TRUE., LDZ >= N.
[out]M
          M is INTEGER
          The dimension of the specified pair of left and right
          eigenspaces, (deflating subspaces) 0 <= M <= N.
[out]PL
          PL is DOUBLE PRECISION
[out]PR
          PR is DOUBLE PRECISION

          If IJOB = 1, 4 or 5, PL, PR are lower bounds on the
          reciprocal  of the norm of "projections" onto left and right
          eigenspace with respect to the selected cluster.
          0 < PL, PR <= 1.
          If M = 0 or M = N, PL = PR  = 1.
          If IJOB = 0, 2 or 3 PL, PR are not referenced.
[out]DIF
          DIF is DOUBLE PRECISION array, dimension (2).
          If IJOB >= 2, DIF(1:2) store the estimates of Difu and Difl.
          If IJOB = 2 or 4, DIF(1:2) are F-norm-based upper bounds on
          Difu and Difl. If IJOB = 3 or 5, DIF(1:2) are 1-norm-based
          estimates of Difu and Difl, computed using reversed
          communication with ZLACN2.
          If M = 0 or N, DIF(1:2) = F-norm([A, B]).
          If IJOB = 0 or 1, DIF is not referenced.
[out]WORK
          WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK. LWORK >=  1
          If IJOB = 1, 2 or 4, LWORK >=  2*M*(N-M)
          If IJOB = 3 or 5, LWORK >=  4*M*(N-M)

          If LWORK = -1, then a workspace query is assumed; the routine
          only calculates the optimal size of the WORK array, returns
          this value as the first entry of the WORK array, and no error
          message related to LWORK is issued by XERBLA.
[out]IWORK
          IWORK is INTEGER array, dimension (MAX(1,LIWORK))
          On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
[in]LIWORK
          LIWORK is INTEGER
          The dimension of the array IWORK. LIWORK >= 1.
          If IJOB = 1, 2 or 4, LIWORK >=  N+2;
          If IJOB = 3 or 5, LIWORK >= MAX(N+2, 2*M*(N-M));

          If LIWORK = -1, then a workspace query is assumed; the
          routine only calculates the optimal size of the IWORK array,
          returns this value as the first entry of the IWORK array, and
          no error message related to LIWORK is issued by XERBLA.
[out]INFO
          INFO is INTEGER
            =0: Successful exit.
            <0: If INFO = -i, the i-th argument had an illegal value.
            =1: Reordering of (A, B) failed because the transformed
                matrix pair (A, B) would be too far from generalized
                Schur form; the problem is very ill-conditioned.
                (A, B) may have been partially reordered.
                If requested, 0 is returned in DIF(*), PL and PR.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2011
Further Details:
  ZTGSEN first collects the selected eigenvalues by computing unitary
  U and W that move them to the top left corner of (A, B). In other
  words, the selected eigenvalues are the eigenvalues of (A11, B11) in

              U**H*(A, B)*W = (A11 A12) (B11 B12) n1
                              ( 0  A22),( 0  B22) n2
                                n1  n2    n1  n2

  where N = n1+n2 and U**H means the conjugate transpose of U. The first
  n1 columns of U and W span the specified pair of left and right
  eigenspaces (deflating subspaces) of (A, B).

  If (A, B) has been obtained from the generalized real Schur
  decomposition of a matrix pair (C, D) = Q*(A, B)*Z**H, then the
  reordered generalized Schur form of (C, D) is given by

           (C, D) = (Q*U)*(U**H *(A, B)*W)*(Z*W)**H,

  and the first n1 columns of Q*U and Z*W span the corresponding
  deflating subspaces of (C, D) (Q and Z store Q*U and Z*W, resp.).

  Note that if the selected eigenvalue is sufficiently ill-conditioned,
  then its value may differ significantly from its value before
  reordering.

  The reciprocal condition numbers of the left and right eigenspaces
  spanned by the first n1 columns of U and W (or Q*U and Z*W) may
  be returned in DIF(1:2), corresponding to Difu and Difl, resp.

  The Difu and Difl are defined as:

       Difu[(A11, B11), (A22, B22)] = sigma-min( Zu )
  and
       Difl[(A11, B11), (A22, B22)] = Difu[(A22, B22), (A11, B11)],

  where sigma-min(Zu) is the smallest singular value of the
  (2*n1*n2)-by-(2*n1*n2) matrix

       Zu = [ kron(In2, A11)  -kron(A22**H, In1) ]
            [ kron(In2, B11)  -kron(B22**H, In1) ].

  Here, Inx is the identity matrix of size nx and A22**H is the
  conjugate transpose of A22. kron(X, Y) is the Kronecker product between
  the matrices X and Y.

  When DIF(2) is small, small changes in (A, B) can cause large changes
  in the deflating subspace. An approximate (asymptotic) bound on the
  maximum angular error in the computed deflating subspaces is

       EPS * norm((A, B)) / DIF(2),

  where EPS is the machine precision.

  The reciprocal norm of the projectors on the left and right
  eigenspaces associated with (A11, B11) may be returned in PL and PR.
  They are computed as follows. First we compute L and R so that
  P*(A, B)*Q is block diagonal, where

       P = ( I -L ) n1           Q = ( I R ) n1
           ( 0  I ) n2    and        ( 0 I ) n2
             n1 n2                    n1 n2

  and (L, R) is the solution to the generalized Sylvester equation

       A11*R - L*A22 = -A12
       B11*R - L*B22 = -B12

  Then PL = (F-norm(L)**2+1)**(-1/2) and PR = (F-norm(R)**2+1)**(-1/2).
  An approximate (asymptotic) bound on the average absolute error of
  the selected eigenvalues is

       EPS * norm((A, B)) / PL.

  There are also global error bounds which valid for perturbations up
  to a certain restriction:  A lower bound (x) on the smallest
  F-norm(E,F) for which an eigenvalue of (A11, B11) may move and
  coalesce with an eigenvalue of (A22, B22) under perturbation (E,F),
  (i.e. (A + E, B + F), is

   x = min(Difu,Difl)/((1/(PL*PL)+1/(PR*PR))**(1/2)+2*max(1/PL,1/PR)).

  An approximate bound on x can be computed from DIF(1:2), PL and PR.

  If y = ( F-norm(E,F) / x) <= 1, the angles between the perturbed
  (L', R') and unperturbed (L, R) left and right deflating subspaces
  associated with the selected cluster in the (1,1)-blocks can be
  bounded as

   max-angle(L, L') <= arctan( y * PL / (1 - y * (1 - PL * PL)**(1/2))
   max-angle(R, R') <= arctan( y * PR / (1 - y * (1 - PR * PR)**(1/2))

  See LAPACK User's Guide section 4.11 or the following references
  for more information.

  Note that if the default method for computing the Frobenius-norm-
  based estimate DIF is not wanted (see ZLATDF), then the parameter
  IDIFJB (see below) should be changed from 3 to 4 (routine ZLATDF
  (IJOB = 2 will be used)). See ZTGSYL for more details.
Contributors:
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
References:
[1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the Generalized Real Schur Form of a Regular Matrix Pair (A, B), in M.S. Moonen et al (eds), Linear Algebra for Large Scale and Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218.
[2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified Eigenvalues of a Regular Matrix Pair (A, B) and Condition Estimation: Theory, Algorithms and Software, Report UMINF - 94.04, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. To appear in Numerical Algorithms, 1996.
[3] B. Kagstrom and P. Poromaa, LAPACK-Style Algorithms and Software for Solving the Generalized Sylvester Equation and Estimating the Separation between Regular Matrix Pairs, Report UMINF - 93.23, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, December 1993, Revised April 1994, Also as LAPACK working Note 75. To appear in ACM Trans. on Math. Software, Vol 22, No 1, 1996.

Definition at line 435 of file ztgsen.f.

435 *
436 * -- LAPACK computational routine (version 3.4.0) --
437 * -- LAPACK is a software package provided by Univ. of Tennessee, --
438 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
439 * November 2011
440 *
441 * .. Scalar Arguments ..
442  LOGICAL wantq, wantz
443  INTEGER ijob, info, lda, ldb, ldq, ldz, liwork, lwork,
444  $ m, n
445  DOUBLE PRECISION pl, pr
446 * ..
447 * .. Array Arguments ..
448  LOGICAL select( * )
449  INTEGER iwork( * )
450  DOUBLE PRECISION dif( * )
451  COMPLEX*16 a( lda, * ), alpha( * ), b( ldb, * ),
452  $ beta( * ), q( ldq, * ), work( * ), z( ldz, * )
453 * ..
454 *
455 * =====================================================================
456 *
457 * .. Parameters ..
458  INTEGER idifjb
459  parameter( idifjb = 3 )
460  DOUBLE PRECISION zero, one
461  parameter( zero = 0.0d+0, one = 1.0d+0 )
462 * ..
463 * .. Local Scalars ..
464  LOGICAL lquery, swap, wantd, wantd1, wantd2, wantp
465  INTEGER i, ierr, ijb, k, kase, ks, liwmin, lwmin, mn2,
466  $ n1, n2
467  DOUBLE PRECISION dscale, dsum, rdscal, safmin
468  COMPLEX*16 temp1, temp2
469 * ..
470 * .. Local Arrays ..
471  INTEGER isave( 3 )
472 * ..
473 * .. External Subroutines ..
474  EXTERNAL xerbla, zlacn2, zlacpy, zlassq, zscal, ztgexc,
475  $ ztgsyl
476 * ..
477 * .. Intrinsic Functions ..
478  INTRINSIC abs, dcmplx, dconjg, max, sqrt
479 * ..
480 * .. External Functions ..
481  DOUBLE PRECISION dlamch
482  EXTERNAL dlamch
483 * ..
484 * .. Executable Statements ..
485 *
486 * Decode and test the input parameters
487 *
488  info = 0
489  lquery = ( lwork.EQ.-1 .OR. liwork.EQ.-1 )
490 *
491  IF( ijob.LT.0 .OR. ijob.GT.5 ) THEN
492  info = -1
493  ELSE IF( n.LT.0 ) THEN
494  info = -5
495  ELSE IF( lda.LT.max( 1, n ) ) THEN
496  info = -7
497  ELSE IF( ldb.LT.max( 1, n ) ) THEN
498  info = -9
499  ELSE IF( ldq.LT.1 .OR. ( wantq .AND. ldq.LT.n ) ) THEN
500  info = -13
501  ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.n ) ) THEN
502  info = -15
503  END IF
504 *
505  IF( info.NE.0 ) THEN
506  CALL xerbla( 'ZTGSEN', -info )
507  RETURN
508  END IF
509 *
510  ierr = 0
511 *
512  wantp = ijob.EQ.1 .OR. ijob.GE.4
513  wantd1 = ijob.EQ.2 .OR. ijob.EQ.4
514  wantd2 = ijob.EQ.3 .OR. ijob.EQ.5
515  wantd = wantd1 .OR. wantd2
516 *
517 * Set M to the dimension of the specified pair of deflating
518 * subspaces.
519 *
520  m = 0
521  DO 10 k = 1, n
522  alpha( k ) = a( k, k )
523  beta( k ) = b( k, k )
524  IF( k.LT.n ) THEN
525  IF( SELECT( k ) )
526  $ m = m + 1
527  ELSE
528  IF( SELECT( n ) )
529  $ m = m + 1
530  END IF
531  10 CONTINUE
532 *
533  IF( ijob.EQ.1 .OR. ijob.EQ.2 .OR. ijob.EQ.4 ) THEN
534  lwmin = max( 1, 2*m*( n-m ) )
535  liwmin = max( 1, n+2 )
536  ELSE IF( ijob.EQ.3 .OR. ijob.EQ.5 ) THEN
537  lwmin = max( 1, 4*m*( n-m ) )
538  liwmin = max( 1, 2*m*( n-m ), n+2 )
539  ELSE
540  lwmin = 1
541  liwmin = 1
542  END IF
543 *
544  work( 1 ) = lwmin
545  iwork( 1 ) = liwmin
546 *
547  IF( lwork.LT.lwmin .AND. .NOT.lquery ) THEN
548  info = -21
549  ELSE IF( liwork.LT.liwmin .AND. .NOT.lquery ) THEN
550  info = -23
551  END IF
552 *
553  IF( info.NE.0 ) THEN
554  CALL xerbla( 'ZTGSEN', -info )
555  RETURN
556  ELSE IF( lquery ) THEN
557  RETURN
558  END IF
559 *
560 * Quick return if possible.
561 *
562  IF( m.EQ.n .OR. m.EQ.0 ) THEN
563  IF( wantp ) THEN
564  pl = one
565  pr = one
566  END IF
567  IF( wantd ) THEN
568  dscale = zero
569  dsum = one
570  DO 20 i = 1, n
571  CALL zlassq( n, a( 1, i ), 1, dscale, dsum )
572  CALL zlassq( n, b( 1, i ), 1, dscale, dsum )
573  20 CONTINUE
574  dif( 1 ) = dscale*sqrt( dsum )
575  dif( 2 ) = dif( 1 )
576  END IF
577  GO TO 70
578  END IF
579 *
580 * Get machine constant
581 *
582  safmin = dlamch( 'S' )
583 *
584 * Collect the selected blocks at the top-left corner of (A, B).
585 *
586  ks = 0
587  DO 30 k = 1, n
588  swap = SELECT( k )
589  IF( swap ) THEN
590  ks = ks + 1
591 *
592 * Swap the K-th block to position KS. Compute unitary Q
593 * and Z that will swap adjacent diagonal blocks in (A, B).
594 *
595  IF( k.NE.ks )
596  $ CALL ztgexc( wantq, wantz, n, a, lda, b, ldb, q, ldq, z,
597  $ ldz, k, ks, ierr )
598 *
599  IF( ierr.GT.0 ) THEN
600 *
601 * Swap is rejected: exit.
602 *
603  info = 1
604  IF( wantp ) THEN
605  pl = zero
606  pr = zero
607  END IF
608  IF( wantd ) THEN
609  dif( 1 ) = zero
610  dif( 2 ) = zero
611  END IF
612  GO TO 70
613  END IF
614  END IF
615  30 CONTINUE
616  IF( wantp ) THEN
617 *
618 * Solve generalized Sylvester equation for R and L:
619 * A11 * R - L * A22 = A12
620 * B11 * R - L * B22 = B12
621 *
622  n1 = m
623  n2 = n - m
624  i = n1 + 1
625  CALL zlacpy( 'Full', n1, n2, a( 1, i ), lda, work, n1 )
626  CALL zlacpy( 'Full', n1, n2, b( 1, i ), ldb, work( n1*n2+1 ),
627  $ n1 )
628  ijb = 0
629  CALL ztgsyl( 'N', ijb, n1, n2, a, lda, a( i, i ), lda, work,
630  $ n1, b, ldb, b( i, i ), ldb, work( n1*n2+1 ), n1,
631  $ dscale, dif( 1 ), work( n1*n2*2+1 ),
632  $ lwork-2*n1*n2, iwork, ierr )
633 *
634 * Estimate the reciprocal of norms of "projections" onto
635 * left and right eigenspaces
636 *
637  rdscal = zero
638  dsum = one
639  CALL zlassq( n1*n2, work, 1, rdscal, dsum )
640  pl = rdscal*sqrt( dsum )
641  IF( pl.EQ.zero ) THEN
642  pl = one
643  ELSE
644  pl = dscale / ( sqrt( dscale*dscale / pl+pl )*sqrt( pl ) )
645  END IF
646  rdscal = zero
647  dsum = one
648  CALL zlassq( n1*n2, work( n1*n2+1 ), 1, rdscal, dsum )
649  pr = rdscal*sqrt( dsum )
650  IF( pr.EQ.zero ) THEN
651  pr = one
652  ELSE
653  pr = dscale / ( sqrt( dscale*dscale / pr+pr )*sqrt( pr ) )
654  END IF
655  END IF
656  IF( wantd ) THEN
657 *
658 * Compute estimates Difu and Difl.
659 *
660  IF( wantd1 ) THEN
661  n1 = m
662  n2 = n - m
663  i = n1 + 1
664  ijb = idifjb
665 *
666 * Frobenius norm-based Difu estimate.
667 *
668  CALL ztgsyl( 'N', ijb, n1, n2, a, lda, a( i, i ), lda, work,
669  $ n1, b, ldb, b( i, i ), ldb, work( n1*n2+1 ),
670  $ n1, dscale, dif( 1 ), work( n1*n2*2+1 ),
671  $ lwork-2*n1*n2, iwork, ierr )
672 *
673 * Frobenius norm-based Difl estimate.
674 *
675  CALL ztgsyl( 'N', ijb, n2, n1, a( i, i ), lda, a, lda, work,
676  $ n2, b( i, i ), ldb, b, ldb, work( n1*n2+1 ),
677  $ n2, dscale, dif( 2 ), work( n1*n2*2+1 ),
678  $ lwork-2*n1*n2, iwork, ierr )
679  ELSE
680 *
681 * Compute 1-norm-based estimates of Difu and Difl using
682 * reversed communication with ZLACN2. In each step a
683 * generalized Sylvester equation or a transposed variant
684 * is solved.
685 *
686  kase = 0
687  n1 = m
688  n2 = n - m
689  i = n1 + 1
690  ijb = 0
691  mn2 = 2*n1*n2
692 *
693 * 1-norm-based estimate of Difu.
694 *
695  40 CONTINUE
696  CALL zlacn2( mn2, work( mn2+1 ), work, dif( 1 ), kase,
697  $ isave )
698  IF( kase.NE.0 ) THEN
699  IF( kase.EQ.1 ) THEN
700 *
701 * Solve generalized Sylvester equation
702 *
703  CALL ztgsyl( 'N', ijb, n1, n2, a, lda, a( i, i ), lda,
704  $ work, n1, b, ldb, b( i, i ), ldb,
705  $ work( n1*n2+1 ), n1, dscale, dif( 1 ),
706  $ work( n1*n2*2+1 ), lwork-2*n1*n2, iwork,
707  $ ierr )
708  ELSE
709 *
710 * Solve the transposed variant.
711 *
712  CALL ztgsyl( 'C', ijb, n1, n2, a, lda, a( i, i ), lda,
713  $ work, n1, b, ldb, b( i, i ), ldb,
714  $ work( n1*n2+1 ), n1, dscale, dif( 1 ),
715  $ work( n1*n2*2+1 ), lwork-2*n1*n2, iwork,
716  $ ierr )
717  END IF
718  GO TO 40
719  END IF
720  dif( 1 ) = dscale / dif( 1 )
721 *
722 * 1-norm-based estimate of Difl.
723 *
724  50 CONTINUE
725  CALL zlacn2( mn2, work( mn2+1 ), work, dif( 2 ), kase,
726  $ isave )
727  IF( kase.NE.0 ) THEN
728  IF( kase.EQ.1 ) THEN
729 *
730 * Solve generalized Sylvester equation
731 *
732  CALL ztgsyl( 'N', ijb, n2, n1, a( i, i ), lda, a, lda,
733  $ work, n2, b( i, i ), ldb, b, ldb,
734  $ work( n1*n2+1 ), n2, dscale, dif( 2 ),
735  $ work( n1*n2*2+1 ), lwork-2*n1*n2, iwork,
736  $ ierr )
737  ELSE
738 *
739 * Solve the transposed variant.
740 *
741  CALL ztgsyl( 'C', ijb, n2, n1, a( i, i ), lda, a, lda,
742  $ work, n2, b, ldb, b( i, i ), ldb,
743  $ work( n1*n2+1 ), n2, dscale, dif( 2 ),
744  $ work( n1*n2*2+1 ), lwork-2*n1*n2, iwork,
745  $ ierr )
746  END IF
747  GO TO 50
748  END IF
749  dif( 2 ) = dscale / dif( 2 )
750  END IF
751  END IF
752 *
753 * If B(K,K) is complex, make it real and positive (normalization
754 * of the generalized Schur form) and Store the generalized
755 * eigenvalues of reordered pair (A, B)
756 *
757  DO 60 k = 1, n
758  dscale = abs( b( k, k ) )
759  IF( dscale.GT.safmin ) THEN
760  temp1 = dconjg( b( k, k ) / dscale )
761  temp2 = b( k, k ) / dscale
762  b( k, k ) = dscale
763  CALL zscal( n-k, temp1, b( k, k+1 ), ldb )
764  CALL zscal( n-k+1, temp1, a( k, k ), lda )
765  IF( wantq )
766  $ CALL zscal( n, temp2, q( 1, k ), 1 )
767  ELSE
768  b( k, k ) = dcmplx( zero, zero )
769  END IF
770 *
771  alpha( k ) = a( k, k )
772  beta( k ) = b( k, k )
773 *
774  60 CONTINUE
775 *
776  70 CONTINUE
777 *
778  work( 1 ) = lwmin
779  iwork( 1 ) = liwmin
780 *
781  RETURN
782 *
783 * End of ZTGSEN
784 *
subroutine zlassq(N, X, INCX, SCALE, SUMSQ)
ZLASSQ updates a sum of squares represented in scaled form.
Definition: zlassq.f:108
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
Definition: zlacpy.f:105
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine zlacn2(N, V, X, EST, KASE, ISAVE)
ZLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: zlacn2.f:135
subroutine ztgexc(WANTQ, WANTZ, N, A, LDA, B, LDB, Q, LDQ, Z, LDZ, IFST, ILST, INFO)
ZTGEXC
Definition: ztgexc.f:202
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
Definition: ztgsyl.f:297
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
subroutine zscal(N, ZA, ZX, INCX)
ZSCAL
Definition: zscal.f:54

Here is the call graph for this function:

Here is the caller graph for this function: