F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentF08NWF (ZGEBAK)

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

F08NWF (ZGEBAK) transforms eigenvectors of a balanced matrix to those of the original complex general matrix.

## 2  Specification

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

## 3  Description

F08NWF (ZGEBAK) is intended to be used after a complex general matrix $A$ has been balanced by F08NVF (ZGEBAL), and eigenvectors of the balanced matrix ${A}_{22}^{\prime \prime }$ have subsequently been computed.
For a description of balancing, see the document for F08NVF (ZGEBAL). The balanced matrix ${A}^{\prime \prime }$ is obtained as ${A}^{\prime \prime }=DPA{P}^{\mathrm{T}}{D}^{-1}$, where $P$ is a permutation matrix and $D$ is a diagonal scaling matrix. This routine transforms left or right eigenvectors as follows:
• if $x$ is a right eigenvector of ${A}^{\prime \prime }$, ${P}^{\mathrm{T}}{D}^{-1}x$ is a right eigenvector of $A$;
• if $y$ is a left eigenvector of ${A}^{\prime \prime }$, ${P}^{\mathrm{T}}Dy$ is a left eigenvector of $A$.

None.

## 5  Parameters

1:     $\mathrm{JOB}$ – CHARACTER(1)Input
On entry: this must be the same parameter JOB as supplied to F08NVF (ZGEBAL).
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 number of rows of the matrix of eigenvectors.
Constraint: ${\mathbf{N}}\ge 0$.
4:     $\mathrm{ILO}$ – INTEGERInput
5:     $\mathrm{IHI}$ – INTEGERInput
On entry: the values ${i}_{\mathrm{lo}}$ and ${i}_{\mathrm{hi}}$, as returned by F08NVF (ZGEBAL).
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{SCALE}\left(*\right)$ – REAL (KIND=nag_wp) arrayInput
Note: the dimension of the array SCALE must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
On entry: details of the permutations and/or the scaling factors used to balance the original complex general matrix, as returned by F08NVF (ZGEBAL).
7:     $\mathrm{M}$ – INTEGERInput
On entry: $m$, the number of columns of the matrix of eigenvectors.
Constraint: ${\mathbf{M}}\ge 0$.
8:     $\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 left or right eigenvectors to be transformed.
On exit: the transformed eigenvectors.
9:     $\mathrm{LDV}$ – INTEGERInput
On entry: the first dimension of the array V as declared in the (sub)program from which F08NWF (ZGEBAK) is called.
Constraint: ${\mathbf{LDV}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{N}}\right)$.
10:   $\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

F08NWF (ZGEBAK) is not threaded by NAG in any implementation.
F08NWF (ZGEBAK) 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 total number of real floating-point operations is approximately proportional to $nm$.