## MB04RD

### Reduction of a real matrix pencil in generalized real Schur form to a block-diagonal form

[Specification] [Arguments] [Method] [References] [Comments] [Example]

Purpose

      To reduce a real matrix pair (A,B) in generalized real Schur form
      to a block-diagonal form using well-conditioned non-orthogonal
      equivalence transformations. The condition numbers of the left and
      right transformations used for the reduction are roughly bounded
      by PMAX, where PMAX is a given value. The transformations are
      optionally postmultiplied in the given matrices X and Y. The
      generalized Schur form is optionally ordered, so that clustered
      eigenvalues are grouped in the same pair of blocks.

Specification

          SUBROUTINE MB04RD( JOBX, JOBY, SORT, N, PMAX, A, LDA, B, LDB, X,
         $                   LDX, Y, LDY, NBLCKS, BLSIZE, ALPHAR, ALPHAI,
         $                   BETA, TOL, IWORK, DWORK, LDWORK, INFO )
    C     .. Scalar Arguments ..
          CHARACTER         JOBX, JOBY, SORT
          INTEGER           INFO, LDA, LDB, LDWORK, LDX, LDY, N, NBLCKS
          DOUBLE PRECISION  PMAX, TOL
    C     .. Array Arguments ..
          INTEGER           BLSIZE(*), IWORK(*)
          DOUBLE PRECISION  A(LDA,*), ALPHAI(*), ALPHAR(*), B(LDB,*),
         $                  BETA(*), DWORK(*), X(LDX,*), Y(LDY,*)

Arguments

Mode Parameters

      JOBX    CHARACTER*1
              Specifies whether or not the left transformations are
              accumulated, as follows:
              = 'N':  The left transformations are not accumulated;
              = 'U':  The left transformations are accumulated in X
                      (the given matrix X is updated).

      JOBY    CHARACTER*1
              Specifies whether or not the right transformations are
              accumulated, as follows:
              = 'N':  The right transformations are not accumulated;
              = 'U':  The right transformations are accumulated in Y
                      (the given matrix Y is updated).

      SORT    CHARACTER*1
              Specifies whether or not the diagonal blocks of the
              generalized real Schur form are reordered, as follows:
              = 'N':  The diagonal blocks are not reordered;
              = 'S':  The diagonal blocks are reordered before each
                      step of reduction, so that clustered eigenvalues
                      appear in the same pair of blocks.
              = 'C':  The diagonal blocks are not reordered, but the
                      "closest-neighbour" strategy is used instead of
                      the standard "closest to the mean" strategy (see
                      METHOD);
              = 'B':  The diagonal blocks are reordered before each
                      step of reduction, and the "closest-neighbour"
                      strategy is used (see METHOD).

Input/Output Parameters

      N       (input) INTEGER
              The order of the matrices A, B, X and Y.  N >= 0.

      PMAX    (input) DOUBLE PRECISION
              An upper bound for the absolute value of the elements of
              the individual transformations used for reduction
              (see METHOD and FURTHER COMMENTS).  PMAX >= 1.0D0.

      A       (input/output) DOUBLE PRECISION array, dimension (LDA,N)
              On entry, the leading N-by-N upper quasi-triangular part
              of this array must contain the upper quasi-triangular
              matrix A in the generalized real Schur form, as returned
              by the LAPACK Library routine DGGES. The lower triangular
              part below the Schur matrix is used as workspace.
              On exit, the leading N-by-N upper quasi-triangular part of
              this array contains the computed block-diagonal matrix, in
              real Schur canonical form, corresponding to the given
              matrix A. The remaining part is set to zero.

      LDA     INTEGER
              The leading dimension of the array A.  LDA >= MAX(1,N).

      B       (input/output) DOUBLE PRECISION array, dimension (LDB,N)
              On entry, the leading N-by-N upper triangular part of this
              array must contain the upper triangular matrix B in the
              generalized real Schur form, as returned by the LAPACK
              Library routine DGGES. The diagonal elements of B are
              non-negative. The strictly lower triangular part is used
              as workspace. The matrix B is assumed nonzero.
              On exit, the leading N-by-N upper triangular part of this
              array contains the computed upper triangular block-
              diagonal matrix, corresponding to the given matrix B. The
              remaining part is set to zero. The diagonal elements of B
              are non-negative.

      LDB     INTEGER
              The leading dimension of the array B.  LDB >= MAX(1,N).

      X       (input/output) DOUBLE PRECISION array, dimension (LDX,*)
              On entry, if JOBX = 'U', the leading N-by-N part of this
              array must contain a given matrix X, for instance the left
              transformation matrix VSL returned by the LAPACK Library
              routine DGGES.
              On exit, if JOBX = 'U', the leading N-by-N part of this
              array contains the product of the given matrix X and the
              left transformation matrix that reduced (A,B) to block-
              diagonal form. The local transformation matrix is itself a
              product of non-orthogonal equivalence transformations
              having elements with magnitude less than or equal to PMAX.
              If JOBX = 'N', this array is not referenced.

      LDX     INTEGER
              The leading dimension of the array X.
              LDX >= 1,        if JOBX = 'N';
              LDX >= MAX(1,N), if JOBX = 'U'.

      Y       (input/output) DOUBLE PRECISION array, dimension (LDY,*)
              On entry, if JOBY = 'U', the leading N-by-N part of this
              array must contain a given matrix Y, for instance the
              right transformation matrix VSR returned by the LAPACK
              Library routine DGGES.
              On exit, if JOBY = 'U', the leading N-by-N part of this
              array contains the product of the given matrix Y and the
              right transformation matrix that reduced (A,B) to block-
              diagonal form. The local transformation matrix is itself a
              product of non-orthogonal equivalence transformations
              having elements with magnitude less than or equal to PMAX.
              If JOBY = 'N', this array is not referenced.

      LDY     INTEGER
              The leading dimension of the array Y.
              LDY >= 1,        if JOBY = 'N';
              LDY >= MAX(1,N), if JOBY = 'U'.

      NBLCKS  (output) INTEGER
              The number of diagonal blocks of the matrices A and B.

      BLSIZE  (output) INTEGER array, dimension (N)
              The first NBLCKS elements of this array contain the orders
              of the resulting diagonal blocks of the matrices A and B.

      ALPHAR  (output) DOUBLE PRECISION array, dimension (N)
      ALPHAI  (output) DOUBLE PRECISION array, dimension (N)
      BETA    (output) DOUBLE PRECISION array, dimension (N)
              On exit, if INFO = 0, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j),
              j = 1, ..., N, will be the generalized eigenvalues.
              ALPHAR(j) + ALPHAI(j)*i, and BETA(j), j = 1, ..., N, are
              the diagonals of the complex Schur form (S,T) that would
              result if the 2-by-2 diagonal blocks of the real Schur
              form of (A,B) were further reduced to triangular form
              using 2-by-2 complex unitary transformations.
              If ALPHAI(j) is zero, then the j-th eigenvalue is real; if
              positive, then the j-th and (j+1)-st eigenvalues are a
              complex conjugate pair, with ALPHAI(j+1) negative.
              All BETA(j) are non-negative real numbers.
              The quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may
              easily over- or underflow, and BETA(j) may even be zero.
              Thus, the user should avoid naively computing the ratio.
              If A and B are obtained from general matrices using DGGES,
              ALPHA will be always less than and usually comparable with
              norm(A) in magnitude, and BETA always less than and
              usually comparable with norm(B).

Tolerances

      TOL     DOUBLE PRECISION
              If SORT = 'S' or 'B', the tolerance to be used in the
              ordering of the diagonal blocks of the upper triangular
              matrix pair.
              If the user sets TOL > 0, then the given value of TOL is
              used as an absolute tolerance: a pair of blocks i and a
              temporarily fixed pair of blocks 1 (the first pair of
              blocks of the current trailing pair of submatrices to be
              reduced) are considered to belong to the same cluster if
              their eigenvalues satisfy the following "distance"
              condition

                | lambda_1 - lambda_i | <= TOL.

              If the user sets TOL < 0, then the given value of TOL is
              used as a relative tolerance: a pair of blocks i and a
              temporarily fixed pair of blocks 1 are considered to
              belong to the same cluster if their eigenvalues satisfy,
              for finite lambda_j, j = 1, ..., N,

                | lambda_1 - lambda_i | <= | TOL | * max | lambda_j |.

              If the user sets TOL = 0, then an implicitly computed,
              default tolerance, defined by TOL = SQRT( SQRT( EPS ) )
              is used instead, as a relative tolerance, where EPS is
              the machine precision (see LAPACK Library routine DLAMCH).
              The approximate symmetric chordal metric is used as
              "distance" of two complex, possibly infinite numbers, x
              and y. This metric is given by the formula

                d(x,y) = min( |x-y|, |1/x-1/y| ),

              taking into account the special cases of infinite or NaN
              values.
              If SORT = 'N' or 'C', this parameter is not referenced.

Workspace

      IWORK   INTEGER array, dimension (N+6)

      DWORK   DOUBLE PRECISION array, dimension (LDWORK)
              On exit, if INFO = 0, DWORK(1) contains the optimal value
              of LDWORK.
              On exit, if INFO = -21, DWORK(1) returns the minimum
              value of LDWORK. When LDWORK = 0 is set on entry, the
              routine will return this value for INFO, and also set
              DWORK(1), but no error message related to LDWORK is
              issued by XERBLA.

      LDWORK  INTEGER
              The dimension of the array DWORK.
              LDWORK >= 1,         if N <= 1;
              LDWORK >= 4*N + 16,  if N >  1.

              If LDWORK = -1, then a workspace query is assumed;
              the routine only calculates the optimal size of the
              DWORK array, returns this value as the first entry of
              the DWORK array, and no error message related to LDWORK
              is issued by XERBLA.

Error Indicator

      INFO    INTEGER
              = 0:  successful exit;
              < 0:  if INFO = -i, the i-th argument had an illegal
                    value;
              = 1:  the matrix pencil defined by A and B is singular.

Method

      Consider first that SORT = 'N'. Let

             ( A    A   )       ( B    B   )
             (  11   12 )       (  11   12 )
         A = (          ),  B = (          ),
             ( 0    A   )       ( 0    B   )
             (       22 )       (       22 )

      be the given matrix pair in generalized real Schur form, where
      initially A   and B   are the first pair of diagonal blocks of
                 11      11
      dimension 1-by-1 or 2-by-2. An attempt is made to compute the
      transformation matrices X and Y of the form

             ( I   V )       ( I   W )
         X = (       ),  Y = (       )                               (1)
             ( 0   I )       ( 0   I )

      (partitioned as A and B ), so that (' denotes the transpose)

                  ( A     0  )            ( B     0  )
                  (  11      )            (  11      )
         X' A Y = (          ),  X' B Y = (          ),
                  ( 0    A   )            ( 0    B   )
                  (       22 )            (       22 )

      and the elements of V and W do not exceed the value PMAX in
      magnitude. An adaptation of the standard method for solving
      generalized Sylvester equations [1], which controls the magnitude
      of the individual elements of the computed solution [2], is used
      to obtain V and W. When this attempt fails, a 1-by-1 (or 2-by-2)
      pair of diagonal blocks of (A  , B  ), whose eigenvalue(s) is
                                   22   22
      (are) the closest to the mean of those of (A  , B  ) is selected,
                                                  11   11
      and moved by orthogonal equivalence transformations in the leading
      position of (A  , B  ); the moved diagonal blocks in A and B are
                    22   22
      then added to the blocks A   and B  , respectively, increasing
                                11      11
      their order by 1 (or 2). Another attempt is made to compute
      suitable transformation matrices X and Y with the new definitions
      of the blocks A  , A  , B  , and B  . After successful
                     11   22   11       22
      transformation matrices X and Y have been obtained, they
      postmultiply the current transformation matrices (if JOBX = 'U'
      and/or JOBY = 'U') and the whole procedure is repeated for the new
      blocks A   and B  .
              22      22

      When SORT = 'S', the diagonal blocks of the generalized real Schur
      form are reordered before each step of the reduction, so that each
      cluster of generalized eigenvalues, defined as specified in the
      definition of TOL, appears in adjacent blocks. The blocks for
      each cluster are merged together, and the procedure described
      above is applied to the larger blocks. Using the option SORT = 'S'
      will usually provide better efficiency than the standard option
      (SORT = 'N'), proposed in [2], because there could be no or few
      unsuccessful attempts to compute individual transformation
      matrices X and Y of the form (1). However, the resulting
      dimensions of the blocks are usually larger; this could make
      subsequent calculations less efficient.

      When SORT = 'C' or 'B', the procedure is similar to that for
      SORT = 'N' or 'S', respectively, but the blocks of A   and B
                                                          22      22
      whose eigenvalue(s) is (are) the closest to those of (A  , B  )
                                                             11   11
      (not to their mean) are selected and moved to the leading position
      of A   and B  . This is called the "closest-neighbour" strategy.
          22      22

References

      [1] Kagstrom, B. and Westin, L.
          Generalized Schur Methods with Condition Estimators for
          Solving the Generalized Sylvester Equation.
          IEEE Trans. Auto. Contr., 34, pp. 745-751, 1989.

      [2] Bavely, C. and Stewart, G.W.
          An Algorithm for Computing Reducing Subspaces by Block
          Diagonalization.
          SIAM J. Numer. Anal., 16, pp. 359-367, 1979.

      [3] Demmel, J.
          The Condition Number of Equivalence Transformations that
          Block Diagonalize Matrix Pencils.
          SIAM J. Numer. Anal., 20, pp. 599-610, 1983.

Numerical Aspects

                                        3                     4
      The algorithm usually requires 0(N ) operations, but 0(N ) are
      possible in the worst case, when the matrix pencil cannot be
      diagonalized by well-conditioned transformations.

Further Comments

      The individual non-orthogonal transformation matrices used in the
      reduction of A and B to a block-diagonal form have condition
      numbers of the order PMAX. This does not guarantee that their
      product is well-conditioned enough. The routine can be easily
      modified to provide estimates for the condition numbers of the
      clusters of generalized eigenvalues.

Example

Program Text

      None

Program Data

      None

Program Results

      None

Return to index