F08WVF (ZGGBAL) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F08WVF (ZGGBAL)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

F08WVF (ZGGBAL) balances a pair of complex square matrices A,B of order n. Balancing usually improves the accuracy of computed generalized eigenvalues and eigenvectors.

2  Specification

SUBROUTINE F08WVF ( JOB, N, A, LDA, B, LDB, ILO, IHI, LSCALE, RSCALE, WORK, INFO)
INTEGER  N, LDA, LDB, ILO, IHI, INFO
REAL (KIND=nag_wp)  LSCALE(N), RSCALE(N), WORK(6*N)
COMPLEX (KIND=nag_wp)  A(LDA,*), B(LDB,*)
CHARACTER(1)  JOB
The routine may be called by its LAPACK name zggbal.

3  Description

Balancing may reduce the 1-norm of the matrices and improve the accuracy of the computed eigenvalues and eigenvectors in the complex generalized eigenvalue problem
Ax=λBx.
F08WVF (ZGGBAL) is usually the first step in the solution of the above generalized eigenvalue problem. Balancing is optional but it is highly recommended.
The term ‘balancing’ covers two steps, each of which involves similarity transformations on A and B. The routine can perform either or both of these steps. Both steps are optional.
  1. The routine first attempts to permute A and B to block upper triangular form by a similarity transformation:
    PAPT=F= F11 F12 F13 F22 F23 F33
    PBPT=G= G11 G12 G13 G22 G23 G33
    where P is a permutation matrix, F11, F33, G11 and G33 are upper triangular. Then the diagonal elements of the matrix pairs F11,G11 and F33,G33 are generalized eigenvalues of A,B. The rest of the generalized eigenvalues are given by the matrix pair F22,G22 which are in rows and columns ilo to ihi. Subsequent operations to compute the generalized eigenvalues of A,B need only be applied to the matrix pair F22,G22; this can save a significant amount of work if ilo>1 and ihi<n. If no suitable permutation exists (as is often the case), the routine sets ilo=1 and ihi=n.
  2. The routine applies a diagonal similarity transformation to F,G, to make the rows and columns of F22,G22 as close in norm as possible:
    DFD^= I 0 0 0 D22 0 0 0 I F11 F12 F13 F22 F23 F33 I 0 0 0 D^22 0 0 0 I
    DGD-1= I 0 0 0 D22 0 0 0 I G11 G12 G13 G22 G23 G33 I 0 0 0 D^22 0 0 0 I
    This transformation usually improves the accuracy of computed generalized eigenvalues and eigenvectors.

4  References

Ward R C (1981) Balancing the generalized eigenvalue problem SIAM J. Sci. Stat. Comp. 2 141–152

5  Parameters

1:     JOB – CHARACTER(1)Input
On entry: specifies the operations to be performed on matrices A and B.
JOB='N'
No balancing is done. Initialize ILO=1, IHI=N, LSCALEi=1.0 and RSCALEi=1.0, for i=1,2,,n.
JOB='P'
Only permutations are used in balancing.
JOB='S'
Only scalings are are used in balancing.
JOB='B'
Both permutations and scalings are used in balancing.
Constraint: JOB='N', 'P', 'S' or 'B'.
2:     N – INTEGERInput
On entry: n, the order of the matrices A and B.
Constraint: N0.
3:     A(LDA,*) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array A must be at least max1,N.
On entry: the n by n matrix A.
On exit: A is overwritten by the balanced matrix. If JOB='N', A is not referenced.
4:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F08WVF (ZGGBAL) is called.
Constraint: LDAmax1,N.
5:     B(LDB,*) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array B must be at least max1,N.
On entry: the n by n matrix B.
On exit: B is overwritten by the balanced matrix. If JOB='N', B is not referenced.
6:     LDB – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which F08WVF (ZGGBAL) is called.
Constraint: LDBmax1,N.
7:     ILO – INTEGEROutput
8:     IHI – INTEGEROutput
On exit: ilo and ihi are set such that Aij=0 and Bij=0 if i>j and 1j<ilo or ihi<in.
If JOB='N' or 'S', ilo=1 and ihi=n.
9:     LSCALE(N) – REAL (KIND=nag_wp) arrayOutput
On exit: details of the permutations and scaling factors applied to the left side of the matrices A and B. If Pi is the index of the row interchanged with row i and di is the scaling factor applied to row i, then
  • LSCALEi=Pi, for i=1,2,,ilo-1;
  • LSCALEi=di, for i=ilo,,ihi;
  • LSCALEi=Pi, for i=ihi+1,,n.
The order in which the interchanges are made is n to ihi+1, then 1 to ilo-1.
10:   RSCALE(N) – REAL (KIND=nag_wp) arrayOutput
On exit: details of the permutations and scaling factors applied to the right side of the matrices A and B.
If Pj is the index of the column interchanged with column j and d^j is the scaling factor applied to column j, then
  • RSCALEj=Pj, for j=1,2,,ilo-1;
  • RSCALEj=d^j, for j=ilo,,ihi;
  • RSCALEj=Pj, for j=ihi+1,,n.
The order in which the interchanges are made is n to ihi+1, then 1 to ilo-1.
11:   WORK(6×N) – REAL (KIND=nag_wp) arrayWorkspace
12:   INFO – INTEGEROutput
On exit: INFO=0 unless the routine detects an error (see Section 6).

6  Error Indicators and Warnings

Errors or warnings detected by the routine:
INFO<0
If INFO=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

7  Accuracy

The errors are negligible, compared to those in subsequent computations.

8  Further Comments

F08WVF (ZGGBAL) is usually the first step in computing the complex generalized eigenvalue problem but it is an optional step. The matrix B is reduced to the triangular form using the QR factorization routine F08ASF (ZGEQRF) and the unitary transformation Q is applied to the matrix A by calling F08AUF (ZUNMQR). This is followed by F08WSF (ZGGHRD) which reduces the matrix pair into the generalized Hessenberg form.
If the matrix pair A,B is balanced by this routine, then any generalized eigenvectors computed subsequently are eigenvectors of the balanced matrix pair. In that case, to compute the generalized eigenvectors of the original matrix, F08WWF (ZGGBAK) must be called.
The total number of floating point operations is approximately proportional to n2.
The real analogue of this routine is F08WHF (DGGBAL).

9  Example

See Section 9 in F08XSF (ZHGEQZ) and F08YXF (ZTGEVC).

F08WVF (ZGGBAL) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012