F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF08WWF (ZGGBAK)

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.

## 1  Purpose

F08WWF (ZGGBAK) forms the right or left eigenvectors of the real generalized eigenvalue problem $Ax=\lambda Bx$, by backward transformation on the computed eigenvectors given by F08YXF (ZTGEVC). It is necessary to call this routine only if the optional balancing routine F08WVF (ZGGBAL) was previously called to balance the matrix pair $\left(A,B\right)$.

## 2  Specification

 SUBROUTINE F08WWF ( JOB, SIDE, N, ILO, IHI, LSCALE, RSCALE, M, V, LDV, INFO)
 INTEGER N, ILO, IHI, M, LDV, INFO REAL (KIND=nag_wp) LSCALE(*), RSCALE(*) COMPLEX (KIND=nag_wp) V(LDV,*) CHARACTER(1) JOB, SIDE
The routine may be called by its LAPACK name zggbak.

## 3  Description

If the matrix pair has been previously balanced using the routine F08WVF (ZGGBAL) then F08WWF (ZGGBAK) backtransforms the eigenvector solution given by F08YXF (ZTGEVC). This is usually the sixth and last step in the solution of the generalized eigenvalue problem.
For a description of balancing, see the document for F08WVF (ZGGBAL).

## 4  References

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

## 5  Parameters

1:     $\mathrm{JOB}$ – CHARACTER(1)Input
On entry: specifies the backtransformation step required.
${\mathbf{JOB}}=\text{'N'}$
No transformations are done.
${\mathbf{JOB}}=\text{'P'}$
Only do backward transformations based on permutations.
${\mathbf{JOB}}=\text{'S'}$
Only do backward transformations based on scaling.
${\mathbf{JOB}}=\text{'B'}$
Do backward transformations for both permutations and scaling.
Note:  this must be identical to the parameter JOB as supplied to F08WHF (DGGBAL).
Constraint: ${\mathbf{JOB}}=\text{'N'}$, $\text{'P'}$, $\text{'S'}$ or $\text{'B'}$.
2:     $\mathrm{SIDE}$ – CHARACTER(1)Input
On entry: indicates whether left or right eigenvectors are to be transformed.
${\mathbf{SIDE}}=\text{'L'}$
The left eigenvectors are transformed.
${\mathbf{SIDE}}=\text{'R'}$
The right eigenvectors are transformed.
Constraint: ${\mathbf{SIDE}}=\text{'L'}$ or $\text{'R'}$.
3:     $\mathrm{N}$ – INTEGERInput
On entry: $n$, the order of the matrices $A$ and $B$ of the generalized eigenvalue problem.
Constraint: ${\mathbf{N}}\ge 0$.
4:     $\mathrm{ILO}$ – INTEGERInput
5:     $\mathrm{IHI}$ – INTEGERInput
On entry: ${i}_{\mathrm{lo}}$ and ${i}_{\mathrm{hi}}$ as determined by a previous call to F08WVF (ZGGBAL).
Constraints:
• if ${\mathbf{N}}>0$, $1\le {\mathbf{ILO}}\le {\mathbf{IHI}}\le {\mathbf{N}}$;
• if ${\mathbf{N}}=0$, ${\mathbf{ILO}}=1$ and ${\mathbf{IHI}}=0$.
6:     $\mathrm{LSCALE}\left(*\right)$ – REAL (KIND=nag_wp) arrayInput
Note: the dimension of the array LSCALE must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
On entry: details of the permutations and scaling factors applied to the left side of the matrices $A$ and $B$, as returned by a previous call to F08WVF (ZGGBAL).
7:     $\mathrm{RSCALE}\left(*\right)$ – REAL (KIND=nag_wp) arrayInput
Note: the dimension of the array RSCALE must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
On entry: details of the permutations and scaling factors applied to the right side of the matrices $A$ and $B$, as returned by a previous call to F08WVF (ZGGBAL).
8:     $\mathrm{M}$ – INTEGERInput
On entry: $m$, the required number of left or right eigenvectors.
Constraint: $0\le {\mathbf{M}}\le {\mathbf{N}}$.
9:     $\mathrm{V}\left({\mathbf{LDV}},*\right)$ – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array V must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{M}}\right)$.
On entry: the matrix of right or left eigenvectors, as returned by F08WVF (ZGGBAL).
On exit: the transformed right or left eigenvectors.
10:   $\mathrm{LDV}$ – INTEGERInput
On entry: the first dimension of the array V as declared in the (sub)program from which F08WWF (ZGGBAK) is called.
Constraint: ${\mathbf{LDV}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
11:   $\mathrm{INFO}$ – INTEGEROutput
On exit: ${\mathbf{INFO}}=0$ unless the routine detects an error (see Section 6).

## 6  Error 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.

## 7  Accuracy

The errors are negligible.

## 8  Parallelism and Performance

F08WWF (ZGGBAK) is not threaded by NAG in any implementation.
F08WWF (ZGGBAK) 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.

The number of operations is proportional to ${n}^{2}$.