F08NUF (ZUNMHR) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

NAG Library Routine Document


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.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

F08NUF (ZUNMHR) multiplies an arbitrary complex matrix C by the complex unitary matrix Q which was determined by F08NSF (ZGEHRD) when reducing a complex general matrix to Hessenberg form.

2  Specification

COMPLEX (KIND=nag_wp)  A(LDA,*), TAU(*), C(LDC,*), WORK(max(1,LWORK))
The routine may be called by its LAPACK name zunmhr.

3  Description

F08NUF (ZUNMHR) is intended to be used following a call to F08NSF (ZGEHRD), which reduces a complex general matrix A to upper Hessenberg form H by a unitary similarity transformation: A=QHQH. F08NSF (ZGEHRD) represents the matrix Q as a product of ihi-ilo elementary reflectors. Here ilo and ihi are values determined by F08NVF (ZGEBAL) when balancing the matrix; if the matrix has not been balanced, ilo=1 and ihi=n.
This routine 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 routine is to transform a matrix V of eigenvectors of H to the matrix QV of eigenvectors of A.

4  References

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

5  Parameters

1:     SIDE – CHARACTER(1)Input
On entry: indicates how Q or QH is to be applied to C.
Q or QH is applied to C from the left.
Q or QH is applied to C from the right.
Constraint: SIDE='L' or 'R'.
2:     TRANS – CHARACTER(1)Input
On entry: indicates whether Q or QH is to be applied to C.
Q is applied to C.
QH is applied to C.
Constraint: TRANS='N' or 'C'.
3:     M – INTEGERInput
On entry: m, the number of rows of the matrix C; m is also the order of Q if SIDE='L'.
Constraint: M0.
4:     N – INTEGERInput
On entry: n, the number of columns of the matrix C; n is also the order of Q if SIDE='R'.
Constraint: N0.
5:     ILO – INTEGERInput
6:     IHI – INTEGERInput
On entry: these must be the same parameters ILO and IHI, respectively, as supplied to F08NSF (ZGEHRD).
  • if SIDE='L' and M>0, 1 ILO IHI M ;
  • if SIDE='L' and M=0, ILO=1 and IHI=0;
  • if SIDE='R' and N>0, 1 ILO IHI N ;
  • if SIDE='R' and N=0, ILO=1 and IHI=0.
7:     A(LDA,*) – COMPLEX (KIND=nag_wp) arrayInput
Note: the second dimension of the array A must be at least max1,M if SIDE='L' and at least max1,N if SIDE='R'.
On entry: details of the vectors which define the elementary reflectors, as returned by F08NSF (ZGEHRD).
8:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F08NUF (ZUNMHR) is called.
  • if SIDE='L', LDA max1,M ;
  • if SIDE='R', LDA max1,N .
9:     TAU(*) – COMPLEX (KIND=nag_wp) arrayInput
Note: the dimension of the array TAU must be at least max1,M-1 if SIDE='L' and at least max1,N-1 if SIDE='R'.
On entry: further details of the elementary reflectors, as returned by F08NSF (ZGEHRD).
10:   C(LDC,*) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array C must be at least max1,N.
On entry: the m by n matrix C.
On exit: C is overwritten by QC or QHC or CQ or CQH as specified by SIDE and TRANS.
11:   LDC – INTEGERInput
On entry: the first dimension of the array C as declared in the (sub)program from which F08NUF (ZUNMHR) is called.
Constraint: LDCmax1,M.
12:   WORK(max1,LWORK) – COMPLEX (KIND=nag_wp) arrayWorkspace
On exit: if INFO=0, the real part of WORK1 contains the minimum value of LWORK required for optimal performance.
13:   LWORK – INTEGERInput
On entry: the dimension of the array WORK as declared in the (sub)program from which F08NUF (ZUNMHR) is called.
If LWORK=-1, a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued.
Suggested value: for optimal performance, LWORKN×nb if SIDE='L' and at least M×nb if SIDE='R', where nb is the optimal block size.
  • if SIDE='L', LWORKmax1,N or LWORK=-1;
  • if SIDE='R', LWORKmax1,M or LWORK=-1.
14:   INFO – INTEGEROutput
On exit: INFO=0 unless the routine detects an error (see Section 6).

6  Error Indicators and Warnings

Errors or warnings detected by the routine:
If INFO=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

7  Accuracy

The computed result differs from the exact result by a matrix E such that
E2 = Oε C2 ,
where ε is the machine precision.

8  Further Comments

The total number of real floating point operations is approximately 8nq2 if SIDE='L' and 8mq2 if SIDE='R', where q=ihi-ilo.
The real analogue of this routine is F08NGF (DORMHR).

9  Example

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 λ such that Reλ<0. Here A is general and must first be reduced to upper Hessenberg form H by F08NSF (ZGEHRD). The program then calls F08PSF (ZHSEQR) to compute the eigenvalues, and F08PXF (ZHSEIN) to compute the required eigenvectors of H by inverse iteration. Finally F08NUF (ZUNMHR) is called to transform the eigenvectors of H back to eigenvectors of the original matrix A.

9.1  Program Text

Program Text (f08nufe.f90)

9.2  Program Data

Program Data (f08nufe.d)

9.3  Program Results

Program Results (f08nufe.r)

F08NUF (ZUNMHR) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012