PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_real_gen_rq (f01qj)
Purpose
nag_matop_real_gen_rq (f01qj) finds the factorization of the real by () matrix , so that is reduced to upper triangular form by means of orthogonal transformations from the right.
Syntax
Description
The
by
matrix
is factorized as
where
is an
by
orthogonal matrix and
is an
by
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.
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
Parameters
Compulsory Input Parameters
- 1:
– double array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
The leading
by
part of the array
a must contain the matrix to be factorized.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a.
, the number of rows of the matrix
.
When then an immediate return is effected.
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
a.
, the number of columns of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
The
by
upper triangular part of
a will contain the upper triangular matrix
, and the
by
strictly lower triangular part of
a and the
by
rectangular part of
a to the right of the upper triangular part will contain details of the factorization as described in
Description.
- 2:
– double array
-
contains the scalar
for the
th transformation. If
then
, otherwise
contains
as described in
Description and
is always in the range
.
- 3:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
On entry, | , |
or | , |
or | . |
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The computed factors
and
satisfy the relation
where
is the
machine precision (see
nag_machine_precision (x02aj)),
is a modest function of
and
, and
denotes the spectral (two) norm.
Further Comments
The approximate number of floating-point operations is given by .
The first
rows of the orthogonal matrix
can be obtained by calling
nag_matop_real_gen_rq_formq (f01qk), which overwrites the
rows of
on the first
rows of the array
a.
is obtained by the call:
[a, ifail] = f01qk('Separate', m, k, a, zeta);
Example
This example obtains the
factorization of the
by
matrix
Open in the MATLAB editor:
f01qj_example
function f01qj_example
fprintf('f01qj example results\n\n');
a = [2, 2, 1.6, 2, 1.2;
2.5, 2.5, -0.4, -0.5, -0.3;
2.5, 2.5, 2.8, 0.5, -2.9];
[RQ, zeta, ifail] = f01qj(a);
disp('RQ Factorization of A');
disp('Vector zeta');
disp(zeta');
disp('Matrix A after factorization (R in left-hand upper triangle');
disp(RQ);
f01qj example results
RQ Factorization of A
Vector zeta
1.0092 1.2981 1.2329
Matrix A after factorization (R in left-hand upper triangle
-3.1446 -1.0705 -2.2283 0.6333 0.7619
0.5277 -2.8345 -2.2283 -0.1662 0.0945
0.3766 0.3766 -5.3852 0.0753 -0.4368
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015