F08NTF (ZUNGHR) (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

F08NTF (ZUNGHR) generates the complex unitary matrix Q which was determined by F08NSF (ZGEHRD) when reducing a complex general matrix A to Hessenberg form.

2  Specification

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

3  Description

F08NTF (ZUNGHR) 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 generate Q explicitly as a square matrix. Q has the structure:
Q = I 0 0 0 Q22 0 0 0 I
where Q22 occupies rows and columns ilo to ihi.

4  References

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

5  Parameters

1:     N – INTEGERInput
On entry: n, the order of the matrix Q.
Constraint: N0.
2:     ILO – INTEGERInput
3:     IHI – INTEGERInput
On entry: these must be the same parameters ILO and IHI, respectively, as supplied to F08NSF (ZGEHRD).
  • if N>0, 1 ILO IHI N ;
  • if N=0, ILO=1 and IHI=0.
4:     A(LDA,*) – COMPLEX (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array A must be at least max1,N.
On entry: details of the vectors which define the elementary reflectors, as returned by F08NSF (ZGEHRD).
On exit: the n by n unitary matrix Q.
5:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F08NTF (ZUNGHR) is called.
Constraint: LDAmax1,N.
6:     TAU(*) – COMPLEX (KIND=nag_wp) arrayInput
Note: the dimension of the array TAU must be at least max1,N-1.
On entry: further details of the elementary reflectors, as returned by F08NSF (ZGEHRD).
7:     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.
8:     LWORK – INTEGERInput
On entry: the dimension of the array WORK as declared in the (sub)program from which F08NTF (ZUNGHR) is called, unless LWORK=-1, in which case a workspace query is assumed and the routine only calculates the optimal dimension of WORK (using the formula given below).
Suggested value: for optimal performance LWORK should be at least IHI-ILO×nb, where nb is the block size.
Constraint: LWORKmax1,IHI-ILO or LWORK=-1.
9:     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 matrix Q differs from an exactly unitary matrix by a matrix E such that
E2 = Oε ,
where ε is the machine precision.

8  Further Comments

The total number of real floating point operations is approximately 163q3, where q=ihi-ilo.
The real analogue of this routine is F08NFF (DORGHR).

9  Example

This example computes the Schur factorization 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 .
Here A is general and must first be reduced to Hessenberg form by F08NSF (ZGEHRD). The program then calls F08NTF (ZUNGHR) to form Q, and passes this matrix to F08PSF (ZHSEQR) which computes the Schur factorization of A.

9.1  Program Text

Program Text (f08ntfe.f90)

9.2  Program Data

Program Data (f08ntfe.d)

9.3  Program Results

Program Results (f08ntfe.r)

F08NTF (ZUNGHR) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

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