NAG CL Interfacef08nuc (zunmhr)

Settings help

CL Name Style:

1Purpose

f08nuc multiplies an arbitrary complex matrix $C$ by the complex unitary matrix $Q$ which was determined by f08nsc when reducing a complex general matrix to Hessenberg form.

2Specification

 #include
 void f08nuc (Nag_OrderType order, Nag_SideType side, Nag_TransType trans, Integer m, Integer n, Integer ilo, Integer ihi, const Complex a[], Integer pda, const Complex tau[], Complex c[], Integer pdc, NagError *fail)
The function may be called by the names: f08nuc, nag_lapackeig_zunmhr or nag_zunmhr.

3Description

f08nuc is intended to be used following a call to f08nsc, which reduces a complex general matrix $A$ to upper Hessenberg form $H$ by a unitary similarity transformation: $A=QH{Q}^{\mathrm{H}}$. f08nsc represents the matrix $Q$ as a product of ${i}_{\mathrm{hi}}-{i}_{\mathrm{lo}}$ elementary reflectors. Here ${i}_{\mathrm{lo}}$ and ${i}_{\mathrm{hi}}$ are values determined by f08nvc when balancing the matrix; if the matrix has not been balanced, ${i}_{\mathrm{lo}}=1$ and ${i}_{\mathrm{hi}}=n$.
This function may be used to form one of the matrix products
 $QC , QHC , CQ ​ or ​ CQH ,$
overwriting the result on $C$ (which may be any complex rectangular matrix).
A common application of this function is to transform a matrix $V$ of eigenvectors of $H$ to the matrix $\mathit{QV}$ of eigenvectors of $A$.

4References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

5Arguments

1: $\mathbf{order}$Nag_OrderType Input
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by ${\mathbf{order}}=\mathrm{Nag_RowMajor}$. See Section 3.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint: ${\mathbf{order}}=\mathrm{Nag_RowMajor}$ or $\mathrm{Nag_ColMajor}$.
2: $\mathbf{side}$Nag_SideType Input
On entry: indicates how $Q$ or ${Q}^{\mathrm{H}}$ is to be applied to $C$.
${\mathbf{side}}=\mathrm{Nag_LeftSide}$
$Q$ or ${Q}^{\mathrm{H}}$ is applied to $C$ from the left.
${\mathbf{side}}=\mathrm{Nag_RightSide}$
$Q$ or ${Q}^{\mathrm{H}}$ is applied to $C$ from the right.
Constraint: ${\mathbf{side}}=\mathrm{Nag_LeftSide}$ or $\mathrm{Nag_RightSide}$.
3: $\mathbf{trans}$Nag_TransType Input
On entry: indicates whether $Q$ or ${Q}^{\mathrm{H}}$ is to be applied to $C$.
${\mathbf{trans}}=\mathrm{Nag_NoTrans}$
$Q$ is applied to $C$.
${\mathbf{trans}}=\mathrm{Nag_ConjTrans}$
${Q}^{\mathrm{H}}$ is applied to $C$.
Constraint: ${\mathbf{trans}}=\mathrm{Nag_NoTrans}$ or $\mathrm{Nag_ConjTrans}$.
4: $\mathbf{m}$Integer Input
On entry: $m$, the number of rows of the matrix $C$; $m$ is also the order of $Q$ if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$.
Constraint: ${\mathbf{m}}\ge 0$.
5: $\mathbf{n}$Integer Input
On entry: $n$, the number of columns of the matrix $C$; $n$ is also the order of $Q$ if ${\mathbf{side}}=\mathrm{Nag_RightSide}$.
Constraint: ${\mathbf{n}}\ge 0$.
6: $\mathbf{ilo}$Integer Input
7: $\mathbf{ihi}$Integer Input
On entry: these must be the same arguments ilo and ihi, respectively, as supplied to f08nsc.
Constraints:
• if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$ and ${\mathbf{m}}>0$, $1\le {\mathbf{ilo}}\le {\mathbf{ihi}}\le {\mathbf{m}}$;
• if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$ and ${\mathbf{m}}=0$, ${\mathbf{ilo}}=1$ and ${\mathbf{ihi}}=0$;
• if ${\mathbf{side}}=\mathrm{Nag_RightSide}$ and ${\mathbf{n}}>0$, $1\le {\mathbf{ilo}}\le {\mathbf{ihi}}\le {\mathbf{n}}$;
• if ${\mathbf{side}}=\mathrm{Nag_RightSide}$ and ${\mathbf{n}}=0$, ${\mathbf{ilo}}=1$ and ${\mathbf{ihi}}=0$.
8: $\mathbf{a}\left[\mathit{dim}\right]$const Complex Input
Note: the dimension, dim, of the array a must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pda}}×{\mathbf{m}}\right)$ when ${\mathbf{side}}=\mathrm{Nag_LeftSide}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pda}}×{\mathbf{n}}\right)$ when ${\mathbf{side}}=\mathrm{Nag_RightSide}$.
On entry: details of the vectors which define the elementary reflectors, as returned by f08nsc.
9: $\mathbf{pda}$Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array a.
Constraints:
• if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$, ${\mathbf{pda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$;
• if ${\mathbf{side}}=\mathrm{Nag_RightSide}$, ${\mathbf{pda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
10: $\mathbf{tau}\left[\mathit{dim}\right]$const Complex Input
Note: the dimension, dim, of the array tau must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}-1\right)$ when ${\mathbf{side}}=\mathrm{Nag_LeftSide}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$ when ${\mathbf{side}}=\mathrm{Nag_RightSide}$.
On entry: further details of the elementary reflectors, as returned by f08nsc.
11: $\mathbf{c}\left[\mathit{dim}\right]$Complex Input/Output
Note: the dimension, dim, of the array c must be at least
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{pdc}}×{\mathbf{n}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}×{\mathbf{pdc}}\right)$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
The $\left(i,j\right)$th element of the matrix $C$ is stored in
• ${\mathbf{c}}\left[\left(j-1\right)×{\mathbf{pdc}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{c}}\left[\left(i-1\right)×{\mathbf{pdc}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On entry: the $m×n$ matrix $C$.
On exit: c is overwritten by $QC$ or ${Q}^{\mathrm{H}}C$ or $CQ$ or $C{Q}^{\mathrm{H}}$ as specified by side and trans.
12: $\mathbf{pdc}$Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array c.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, ${\mathbf{pdc}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$;
• if ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${\mathbf{pdc}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
13: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument $⟨\mathit{\text{value}}⟩$ had an illegal value.
NE_ENUM_INT_3
On entry, ${\mathbf{side}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{pda}}=⟨\mathit{\text{value}}⟩$.
Constraint: if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$, ${\mathbf{pda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$;
if ${\mathbf{side}}=\mathrm{Nag_RightSide}$, ${\mathbf{pda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry, ${\mathbf{side}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{pda}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$, ${\mathbf{pda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$;
if ${\mathbf{side}}=\mathrm{Nag_RightSide}$, ${\mathbf{pda}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
NE_ENUM_INT_4
On entry, ${\mathbf{side}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{ilo}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{ihi}}=⟨\mathit{\text{value}}⟩$.
Constraint: if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$ and ${\mathbf{m}}>0$, $1\le {\mathbf{ilo}}\le {\mathbf{ihi}}\le {\mathbf{m}}$;
if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$ and ${\mathbf{m}}=0$, ${\mathbf{ilo}}=1$ and ${\mathbf{ihi}}=0$;
if ${\mathbf{side}}=\mathrm{Nag_RightSide}$ and ${\mathbf{n}}>0$, $1\le {\mathbf{ilo}}\le {\mathbf{ihi}}\le {\mathbf{n}}$;
if ${\mathbf{side}}=\mathrm{Nag_RightSide}$ and ${\mathbf{n}}=0$, ${\mathbf{ilo}}=1$ and ${\mathbf{ihi}}=0$.
NE_INT
On entry, ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{m}}\ge 0$.
On entry, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{n}}\ge 0$.
On entry, ${\mathbf{pda}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{pda}}>0$.
On entry, ${\mathbf{pdc}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{pdc}}>0$.
NE_INT_2
On entry, ${\mathbf{pdc}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{pdc}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.
On entry, ${\mathbf{pdc}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{pdc}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.

7Accuracy

The computed result differs from the exact result by a matrix $E$ such that
 $‖E‖2 = O(ε) ‖C‖2 ,$
where $\epsilon$ is the machine precision.

8Parallelism and Performance

f08nuc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f08nuc 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 function. 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 $8n{q}^{2}$ if ${\mathbf{side}}=\mathrm{Nag_LeftSide}$ and $8m{q}^{2}$ if ${\mathbf{side}}=\mathrm{Nag_RightSide}$, where $q={i}_{\mathrm{hi}}-{i}_{\mathrm{lo}}$.
The real analogue of this function is f08ngc.

10Example

This example computes all the eigenvalues of the matrix $A$, where
 $A = ( -3.97-5.04i -4.11+3.70i -0.34+1.01i 1.29-0.86i 0.34-1.50i 1.52-0.43i 1.88-5.38i 3.36+0.65i 3.31-3.85i 2.50+3.45i 0.88-1.08i 0.64-1.48i -1.10+0.82i 1.81-1.59i 3.25+1.33i 1.57-3.44i ) ,$
and those eigenvectors which correspond to eigenvalues $\lambda$ such that $\mathrm{Re}\left(\lambda \right)<0$. Here $A$ is general and must first be reduced to upper Hessenberg form $H$ by f08nsc. The program then calls f08psc to compute the eigenvalues, and f08pxc to compute the required eigenvectors of $H$ by inverse iteration. Finally f08nuc is called to transform the eigenvectors of $H$ back to eigenvectors of the original matrix $A$.

10.1Program Text

Program Text (f08nuce.c)

10.2Program Data

Program Data (f08nuce.d)

10.3Program Results

Program Results (f08nuce.r)