f01qjf finds the factorization of the real () matrix , so that is reduced to upper triangular form by means of orthogonal transformations from the right.
The routine may be called by the names f01qjf or nagf_matop_real_gen_rq.
3Description
The matrix is factorized as
where is an orthogonal matrix and is an upper triangular matrix.
is given as a sequence of Householder transformation matrices
the ()th transformation matrix, , being used to introduce zeros into the th row of . has the form
where
is a scalar, is an element vector and is an element vector. is chosen to annihilate the elements in the th row of .
The vector is returned in the th element of zeta and in the th row of a, such that is in , the elements of are in and the elements of are in . The elements of are returned in the upper triangular part of a.
4References
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
5Arguments
1: – IntegerInput
On entry: , the number of rows of the matrix .
When then an immediate return is effected.
Constraint:
.
2: – IntegerInput
On entry: , the number of columns of the matrix .
Constraint:
.
3: – Real (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array a
must be at least
.
On entry: the leading part of the array a must contain the matrix to be factorized.
On exit: the upper triangular part of a will contain the upper triangular matrix , and the strictly lower triangular part of a and the rectangular part of a to the right of the upper triangular part will contain details of the factorization as described in Section 3.
4: – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f01qjf is called.
Constraint:
.
5: – Real (Kind=nag_wp) arrayOutput
On exit: contains the scalar for the th transformation. If then , otherwise contains as described in Section 3 and is always in the range .
6: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, and .
Constraint: .
On entry, .
Constraint: .
On entry, and .
Constraint: .
An unexpected error has been triggered by this routine. Please
contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
7Accuracy
The computed factors and satisfy the relation
where
is the machine precision (see x02ajf), is a modest function of and , and denotes the spectral (two) norm.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
f01qjf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9Further Comments
The approximate number of floating-point operations is given by .
The first rows of the orthogonal matrix can be obtained by calling f01qkf, which overwrites the rows of on the first rows of the array a.
is obtained by the call:
must be a element array. If is larger than , then a must have been declared to have at least rows.
Operations involving the matrix can readily be performed by the Level 2 BLAS routines f06pffandf06pjf (see Chapter F06), but note that no test for near singularity of is incorporated into f06pjf. If is singular, or nearly singular then f02wuf can be used to determine the singular value decomposition of .
10Example
This example obtains the factorization of the matrix