F01QKF (PDF version)
F01 Chapter Contents
F01 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

F01QKF returns the first  rows of the real n by n orthogonal matrix PT, where P is given as the product of Householder transformation matrices.
This routine is intended for use following F01QJF.

2  Specification

REAL (KIND=nag_wp)  A(LDA,*), ZETA(*), WORK(max(M-1,NROWP-M,1))

3  Description

P is assumed to be given by
Pk = I - uk ukT , uk= wk ζk 0 zk ,
ζk is a scalar, wk is a (k-1) element vector and zk is an (n-m) element vector. wk must be supplied in the kth row of A in elements Ak1,,Akk-1. zk must be supplied in the kth row of A in elements Akm+1,,Akn and ζk must be supplied either in Akk or in ZETAk, depending upon the parameter WHERET.

4  References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Wilkinson J H (1965) The Algebraic Eigenvalue Problem Oxford University Press, Oxford

5  Parameters

1:     WHERET – CHARACTER(1)Input
On entry: indicates where the elements of ζ are to be found.
The elements of ζ are in A.
WHERET='S' (Separate)
The elements of ζ are separate from A, in ZETA.
Constraint: WHERET='I' or 'S'.
2:     M – INTEGERInput
On entry: m, the number of rows of the matrix A.
Constraint: M0.
3:     N – INTEGERInput
On entry: n, the number of columns of the matrix A.
Constraint: NM.
4:     NROWP – INTEGERInput
On entry: , the required number of rows of P.
If NROWP=0, an immediate return is effected.
Constraint: 0NROWPN.
5:     A(LDA,*) – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array A must be at least max1,N.
On entry: the leading m by m strictly lower triangular part of the array A, and the m by (n-m) rectangular part of A with top left-hand corner at element A1M+1 must contain details of the matrix P. In addition, when WHERET='I', then the diagonal elements of A must contain the elements of ζ.
On exit: the first NROWP rows of the array A are overwritten by the first NROWP rows of the n by n orthogonal matrix PT.
6:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F01QKF is called.
Constraint: LDAmax1,M,NROWP.
7:     ZETA(*) – REAL (KIND=nag_wp) arrayInput
Note: the dimension of the array ZETA must be at least max1,M if WHERET='S', and at least 1 otherwise.
On entry: with WHERET='S', the array ZETA must contain the elements of ζ. If ZETAk=0.0 then Pk is assumed to be I, otherwise ZETAk is assumed to contain ζk.
When WHERET='I', the array ZETA is not referenced.
8:     WORK(maxM-1,NROWP-M,1) – REAL (KIND=nag_wp) arrayWorkspace
Note: the dimension of the array WORK must be at least maxM-1,NROWP-M,1.
9:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
On entry,WHERET'I' or 'S',

7  Accuracy

The computed matrix P satisfies the relation
where Q is an exactly orthogonal matrix and
ε is the machine precision (see X02AJF), c is a modest function of n, and . denotes the spectral (two) norm. See also Section 7 in F01QJF.

8  Further Comments

The approximate number of floating point operations is given by
23m3n-m2-m-m-m, if ​m, and ​ 2323n-, if ​<m.

9  Example

This example obtains the 5 by 5 orthogonal matrix P following the RQ factorization of the 3 by 5 matrix A given by
A= 2.0 2.0 1.6 2.0 1.2 2.5 2.5 -0.4 -0.5 -0.3 2.5 2.5 2.8 0.5 -2.9 .

9.1  Program Text

Program Text (f01qkfe.f90)

9.2  Program Data

Program Data (f01qkfe.d)

9.3  Program Results

Program Results (f01qkfe.r)

F01QKF (PDF version)
F01 Chapter Contents
F01 Chapter Introduction
NAG Library Manual

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