F08NFF (DORGHR) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F08NFF (DORGHR)

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

F08NFF (DORGHR) generates the real orthogonal matrix Q which was determined by F08NEF (DGEHRD) when reducing a real general matrix A to Hessenberg form.

2  Specification

SUBROUTINE F08NFF ( N, ILO, IHI, A, LDA, TAU, WORK, LWORK, INFO)
INTEGER  N, ILO, IHI, LDA, LWORK, INFO
REAL (KIND=nag_wp)  A(LDA,*), TAU(*), WORK(max(1,LWORK))
The routine may be called by its LAPACK name dorghr.

3  Description

F08NFF (DORGHR) is intended to be used following a call to F08NEF (DGEHRD), which reduces a real general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: A=QHQT. F08NEF (DGEHRD) represents the matrix Q as a product of ihi-ilo elementary reflectors. Here ilo and ihi are values determined by F08NHF (DGEBAL) 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 F08NEF (DGEHRD).
Constraints:
  • if N>0, 1 ILO IHI N ;
  • if N=0, ILO=1 and IHI=0.
4:     A(LDA,*) – REAL (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 F08NEF (DGEHRD).
On exit: the n by n orthogonal matrix Q.
5:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F08NFF (DORGHR) is called.
Constraint: LDAmax1,N.
6:     TAU(*) – REAL (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 F08NEF (DGEHRD).
7:     WORK(max1,LWORK) – REAL (KIND=nag_wp) arrayWorkspace
On exit: if INFO=0, 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 F08NFF (DORGHR) 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:
INFO<0
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 orthogonal matrix by a matrix E such that
E2 = Oε ,
where ε is the machine precision.

8  Further Comments

The total number of floating point operations is approximately 43q3, where q=ihi-ilo.
The complex analogue of this routine is F08NTF (ZUNGHR).

9  Example

This example computes the Schur factorization of the matrix A, where
A = 0.35 0.45 -0.14 -0.17 0.09 0.07 -0.54 0.35 -0.44 -0.33 -0.03 0.17 0.25 -0.32 -0.13 0.11 .
Here A is general and must first be reduced to Hessenberg form by F08NEF (DGEHRD). The program then calls F08NFF (DORGHR) to form Q, and passes this matrix to F08PEF (DHSEQR) which computes the Schur factorization of A.

9.1  Program Text

Program Text (f08nffe.f90)

9.2  Program Data

Program Data (f08nffe.d)

9.3  Program Results

Program Results (f08nffe.r)


F08NFF (DORGHR) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

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