nag_dgebal (f08nhc) balances a real general matrix in order to improve the accuracy of computed eigenvalues and/or eigenvectors.
nag_dgebal (f08nhc) balances a real general matrix
. The term ‘balancing’ covers two steps, each of which involves a similarity transformation of
. The function can perform either or both of these steps.
- The function first attempts to permute to block upper triangular form by a similarity transformation:
where is a permutation matrix, and and are upper triangular. Then the diagonal elements of and are eigenvalues of . The rest of the eigenvalues of are the eigenvalues of the central diagonal block , in rows and columns to . Subsequent operations to compute the eigenvalues of (or its Schur factorization) need only be applied to these rows and columns; this can save a significant amount of work if and . If no suitable permutation exists (as is often the case), the function sets and , and is the whole of .
- The function applies a diagonal similarity transformation to , to make the rows and columns of as close in norm as possible:
This scaling can reduce the norm of the matrix (i.e., ) and hence reduce the effect of rounding errors on the accuracy of computed eigenvalues and eigenvectors.
The errors are negligible.
If the matrix
is balanced by nag_dgebal (f08nhc), then any eigenvectors computed subsequently are eigenvectors of the matrix
(see
Section 3) and hence
nag_dgebak (f08njc)
must then be called to transform them back to eigenvectors of
.
If the Schur vectors of
are required, then this function must
not be called with
or
, because then the balancing transformation is not orthogonal. If this function is called with
, then any Schur vectors computed subsequently are Schur vectors of the matrix
, and
nag_dgebak (f08njc) must be called (with
)
to transform them back to Schur vectors of
.
The complex analogue of this function is
nag_zgebal (f08nvc).
This example computes all the eigenvalues and right eigenvectors of the matrix
, where
The program first calls nag_dgebal (f08nhc) to balance the matrix; it then computes the Schur factorization of the balanced matrix, by reduction to Hessenberg form and the
algorithm. Then it calls
nag_dtrevc (f08qkc) to compute the right eigenvectors of the balanced matrix, and finally calls
nag_dgebak (f08njc) to transform the eigenvectors back to eigenvectors of the original matrix
.