NAG FL Interfacef08wvf (zggbal)

▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

1Purpose

f08wvf balances a pair of complex square matrices $\left(A,B\right)$ of order $n$. Balancing usually improves the accuracy of computed generalized eigenvalues and eigenvectors.

2Specification

Fortran Interface
 Subroutine f08wvf ( job, n, a, lda, b, ldb, ilo, ihi, work, info)
 Integer, Intent (In) :: n, lda, ldb Integer, Intent (Out) :: ilo, ihi, info Real (Kind=nag_wp), Intent (Out) :: lscale(n), rscale(n), work(6*n) Complex (Kind=nag_wp), Intent (Inout) :: a(lda,*), b(ldb,*) Character (1), Intent (In) :: job
#include <nag.h>
 void f08wvf_ (const char *job, const Integer *n, Complex a[], const Integer *lda, Complex b[], const Integer *ldb, Integer *ilo, Integer *ihi, double lscale[], double rscale[], double work[], Integer *info, const Charlen length_job)
The routine may be called by the names f08wvf, nagf_lapackeig_zggbal or its LAPACK name zggbal.

3Description

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 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. 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, ${F}_{11}$, ${F}_{33}$, ${G}_{11}$ and ${G}_{33}$ are upper triangular. Then the diagonal elements of the matrix pairs $\left({F}_{11},{G}_{11}\right)$ and $\left({F}_{33},{G}_{33}\right)$ are generalized eigenvalues of $\left(A,B\right)$. The rest of the generalized eigenvalues are given by the matrix pair $\left({F}_{22},{G}_{22}\right)$ which are in rows and columns ${i}_{\mathrm{lo}}$ to ${i}_{\mathrm{hi}}$. Subsequent operations to compute the generalized eigenvalues of $\left(A,B\right)$ need only be applied to the matrix pair $\left({F}_{22},{G}_{22}\right)$; this can save a significant amount of work if ${i}_{\mathrm{lo}}>1$ and ${i}_{\mathrm{hi}}. If no suitable permutation exists (as is often the case), the routine sets ${i}_{\mathrm{lo}}=1$ and ${i}_{\mathrm{hi}}=n$.
2. 2.The routine applies a diagonal similarity transformation to $\left(F,G\right)$, to make the rows and columns of $\left({F}_{22},{G}_{22}\right)$ 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.
Ward R C (1981) Balancing the generalized eigenvalue problem SIAM J. Sci. Stat. Comp. 2 141–152

5Arguments

1: $\mathbf{job}$Character(1) Input
On entry: specifies the operations to be performed on matrices $A$ and $B$.
${\mathbf{job}}=\text{'N'}$
No balancing is done. Initialize ${\mathbf{ilo}}=1$, ${\mathbf{ihi}}={\mathbf{n}}$, ${\mathbf{lscale}}\left(\mathit{i}\right)=1.0$ and ${\mathbf{rscale}}\left(\mathit{i}\right)=1.0$, for $\mathit{i}=1,2,\dots ,n$.
${\mathbf{job}}=\text{'P'}$
Only permutations are used in balancing.
${\mathbf{job}}=\text{'S'}$
Only scalings are are used in balancing.
${\mathbf{job}}=\text{'B'}$
Both permutations and scalings are used in balancing.
Constraint: ${\mathbf{job}}=\text{'N'}$, $\text{'P'}$, $\text{'S'}$ or $\text{'B'}$.
2: $\mathbf{n}$Integer Input
On entry: $n$, the order of the matrices $A$ and $B$.
Constraint: ${\mathbf{n}}\ge 0$.
3: $\mathbf{a}\left({\mathbf{lda}},*\right)$Complex (Kind=nag_wp) array Input/Output
Note: the second dimension of the array a must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $n×n$ matrix $A$.
On exit: a is overwritten by the balanced matrix. If ${\mathbf{job}}=\text{'N'}$, a is not referenced.
4: $\mathbf{lda}$Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f08wvf is called.
Constraint: ${\mathbf{lda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
5: $\mathbf{b}\left({\mathbf{ldb}},*\right)$Complex (Kind=nag_wp) array Input/Output
Note: the second dimension of the array b must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $n×n$ matrix $B$.
On exit: b is overwritten by the balanced matrix. If ${\mathbf{job}}=\text{'N'}$, b is not referenced.
6: $\mathbf{ldb}$Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f08wvf is called.
Constraint: ${\mathbf{ldb}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
7: $\mathbf{ilo}$Integer Output
8: $\mathbf{ihi}$Integer Output
On exit: ${i}_{\mathrm{lo}}$ and ${i}_{\mathrm{hi}}$ are set such that ${\mathbf{a}}\left(i,j\right)=0$ and ${\mathbf{b}}\left(i,j\right)=0$ if $i>j$ and $1\le j<{i}_{\mathrm{lo}}$ or ${i}_{\mathrm{hi}}.
If ${\mathbf{job}}=\text{'N'}$ or $\text{'S'}$, ${i}_{\mathrm{lo}}=1$ and ${i}_{\mathrm{hi}}=n$.
9: $\mathbf{lscale}\left({\mathbf{n}}\right)$Real (Kind=nag_wp) array Output
On exit: details of the permutations and scaling factors applied to the left side of the matrices $A$ and $B$. If ${P}_{i}$ is the index of the row interchanged with row $i$ and ${d}_{i}$ is the scaling factor applied to row $i$, then
• ${\mathbf{lscale}}\left(\mathit{i}\right)={P}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,{\mathit{i}}_{\mathrm{lo}}-1$;
• ${\mathbf{lscale}}\left(\mathit{i}\right)={\mathit{d}}_{\mathit{i}}$, for $\mathit{i}={\mathit{i}}_{\mathrm{lo}},\dots ,{\mathit{i}}_{\mathrm{hi}}$;
• ${\mathbf{lscale}}\left(\mathit{i}\right)={P}_{\mathit{i}}$, for $\mathit{i}={\mathit{i}}_{\mathrm{hi}}+1,\dots ,n$.
The order in which the interchanges are made is $n$ to ${i}_{\mathrm{hi}}+1$, then $1$ to ${i}_{\mathrm{lo}}-1$.
10: $\mathbf{rscale}\left({\mathbf{n}}\right)$Real (Kind=nag_wp) array Output
On exit: details of the permutations and scaling factors applied to the right side of the matrices $A$ and $B$.
If ${P}_{j}$ is the index of the column interchanged with column $j$ and ${\stackrel{^}{d}}_{j}$ is the scaling factor applied to column $j$, then
• ${\mathbf{rscale}}\left(\mathit{j}\right)={P}_{\mathit{j}}$, for $\mathit{j}=1,2,\dots ,{\mathit{i}}_{\mathrm{lo}}-1$;
• ${\mathbf{rscale}}\left(\mathit{j}\right)={\stackrel{^}{d}}_{\mathit{j}}$, for $\mathit{j}={i}_{\mathrm{lo}},\dots ,{i}_{\mathrm{hi}}$;
• ${\mathbf{rscale}}\left(\mathit{j}\right)={P}_{\mathit{j}}$, for $\mathit{j}={i}_{\mathrm{hi}}+1,\dots ,n$.
The order in which the interchanges are made is $n$ to ${i}_{\mathrm{hi}}+1$, then $1$ to ${i}_{\mathrm{lo}}-1$.
11: $\mathbf{work}\left(6×{\mathbf{n}}\right)$Real (Kind=nag_wp) array Workspace
12: $\mathbf{info}$Integer Output
On exit: ${\mathbf{info}}=0$ unless the routine detects an error (see Section 6).

6Error Indicators and Warnings

${\mathbf{info}}<0$
If ${\mathbf{info}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.

7Accuracy

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

8Parallelism and Performance

f08wvf 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.

f08wvf 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 and the unitary transformation $Q$ is applied to the matrix $A$ by calling f08auf. This is followed by f08wtf which reduces the matrix pair into the generalized Hessenberg form.
If the matrix pair $\left(A,B\right)$ 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 must be called.
The total number of floating-point operations is approximately proportional to ${n}^{2}$.