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.
F08WHF (DGGBAL) balances a pair of real square matrices of order . Balancing usually improves the accuracy of computed generalized eigenvalues and eigenvectors.
The routine may be called by its
LAPACK
name dggbal.
3 Description
Balancing may reduce the -norms of the matrices and improve the accuracy of the computed eigenvalues and eigenvectors in the real generalized eigenvalue problem
F08WHF (DGGBAL) 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 and . The routine can perform either or both of these steps. Both steps are optional.
1.
The routine first attempts to permute and to block upper triangular form by a similarity transformation:
where is a permutation matrix, , , and are upper triangular. Then the diagonal elements of the matrix pairs and are generalized eigenvalues of . The rest of the generalized eigenvalues are given by the matrix pair which are in rows and columns to . Subsequent operations to compute the generalized eigenvalues of need only be applied to the matrix pair ; this can save a significant amount of work if and . If no suitable permutation exists (as is often the case), the routine sets and .
2.
The routine applies a diagonal similarity transformation to , to make the rows and columns of as close in norm as possible:
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: – CHARACTER(1)Input
On entry: specifies the operations to be performed on matrices and .
No balancing is done. Initialize , ,
and , for .
Only permutations are used in balancing.
Only scalings are are used in balancing.
Both permutations and scalings are used in balancing.
Constraint:
, , or .
2: – INTEGERInput
On entry: , the order of the matrices and .
Constraint:
.
3: – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array A
must be at least
.
On entry: the by matrix .
On exit: A is overwritten by the balanced matrix. If , A is not referenced.
4: – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F08WHF (DGGBAL) is called.
Constraint:
.
5: – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array B
must be at least
.
On entry: the by matrix .
On exit: B is overwritten by the balanced matrix. If , B is not referenced.
6: – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which F08WHF (DGGBAL) is called.
Constraint:
.
7: – INTEGEROutput
8: – INTEGEROutput
On exit: and are set such that and if and or .
If or , and .
9: – REAL (KIND=nag_wp) arrayOutput
On exit: details of the permutations and scaling factors applied to the left side of the matrices and . If is the index of the row interchanged with row and is the scaling factor applied to row , then
, for ;
, for ;
, for .
The order in which the interchanges are made is to , then to .
10: – REAL (KIND=nag_wp) arrayOutput
On exit: details of the permutations and scaling factors applied to the right side of the matrices and .
If is the index of the column interchanged with column and is the scaling factor applied to column , then
, for ;
, for ;
, for .
The order in which the interchanges are made is to , then to .
11: – REAL (KIND=nag_wp) arrayWorkspace
Note: the dimension of the array WORK
must be at least
if or and at least if or .
12: – INTEGEROutput
On exit: unless the routine detects an error (see Section 6).
6 Error Indicators and Warnings
If , argument 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 Parallelism and Performance
F08WHF (DGGBAL) is not threaded by NAG in any implementation.
F08WHF (DGGBAL) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9 Further Comments
F08WHF (DGGBAL) is usually the first step in computing the real generalized eigenvalue problem but it is an optional step. The matrix is reduced to the upper triangular form using the factorization routine F08AEF (DGEQRF) and this orthogonal transformation is applied to the matrix by calling F08AGF (DORMQR). This is followed by F08WEF (DGGHRD) which reduces the matrix pair into the generalized Hessenberg form.
If the matrix pair 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, F08WJF (DGGBAK) must be called.
The total number of floating-point operations is approximately proportional to .