F01RJF (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

F01RJF finds the RQ factorization of the complex m by n (mn), matrix A, so that A is reduced to upper triangular form by means of unitary transformations from the right.

2  Specification


3  Description

The m by n matrix A is factorized as
A= R 0 PH when ​m<n, A=RPH when ​m=n,
where P is an n by n unitary matrix and R is an m by m upper triangular matrix.
P is given as a sequence of Householder transformation matrices
the m-k+1th transformation matrix, Pk, being used to introduce zeros into the kth row of A. Pk has the form
uk= wk ζk 0 zk .
γk is a scalar for which Reγk=1.0, ζk is a real scalar, wk is a k-1 element vector and zk is an n-m element vector. γk and uk are chosen to annihilate the elements in the kth row of A.
The scalar γk and the vector uk are returned in the kth element of THETA and in the kth row of A, such that θk, given by
is in THETAk, the elements of wk are in Ak1,,Akk-1 and the elements of zk are in Akm+1,,Akn. The elements of R are returned in the upper triangular part of A.

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:     M – INTEGERInput
On entry: m, the number of rows of the matrix A.
When M=0 then an immediate return is effected.
Constraint: M0.
2:     N – INTEGERInput
On entry: n, the number of columns of the matrix A.
Constraint: NM.
3:     A(LDA,*) – COMPLEX (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 n part of the array A must contain the matrix to be factorized.
On exit: the m by m upper triangular part of A will contain the upper triangular matrix R, and the m by m strictly lower triangular part of A and the m by n-m rectangular part of A to the right of the upper triangular part will contain details of the factorization as described in Section 3.
4:     LDA – INTEGERInput
On entry: the first dimension of the array A as declared in the (sub)program from which F01RJF is called.
Constraint: LDAmax1,M.
5:     THETA(M) – COMPLEX (KIND=nag_wp) arrayOutput
On exit: THETAk contains the scalar θk for the m-k+1th transformation. If Pk=I then THETAk=0.0; if
Tk= I 0 0 0 α 0 0 0 I ,  Reα<0.0
then THETAk=α, otherwise THETAk contains θk as described in Section 3 and θk is always in the range 1.0,2.0.
6:     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,M<0,

7  Accuracy

The computed factors R and P satisfy the relation
Ecε A,
ε is the machine precision (see X02AJF), c is a modest function of m and n, and . denotes the spectral (two) norm.

8  Further Comments

The approximate number of floating point operations is given by 8m23n-m/3.
The first k rows of the unitary matrix PH can be obtained by calling F01RKF, which overwrites the k rows of PH on the first k rows of the array A. PH is obtained by the call:
WORK must be a maxm-1,k-m,1 element array. If K is larger than M, then A must have been declared to have at least K rows.
Operations involving the matrix R can readily be performed by the Level 2 BLAS routines F06SFF (ZTRMV) and F06SJF (ZTRSV), (see Chapter F06), but note that no test for near singularity of R is incorporated into F06SFF (ZTRMV). If R is singular, or nearly singular then F02XUF can be used to determine the singular value decomposition of R.

9  Example

This example obtains the RQ factorization of the 3 by 5 matrix
A= -0.5i 0.4-0.3i 0.4i+0.0 0.3-0.4i 0.3i -0.5-1.5i 0.9-1.3i -0.4-0.4i 0.1-0.7i 0.3-0.3i -1.0-1.0i 0.2-1.4i 1.8i+0.0 0.0i+0.0 -2.4i .

9.1  Program Text

Program Text (f01rjfe.f90)

9.2  Program Data

Program Data (f01rjfe.d)

9.3  Program Results

Program Results (f01rjfe.r)

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

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