PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_real_trapez_rq (f01qg)
Purpose
nag_matop_real_trapez_rq (f01qg) reduces the by () real upper trapezoidal matrix to upper triangular form by means of orthogonal transformations.
Syntax
Description
The
by
(
) real upper trapezoidal matrix
given by
where
is an
by
upper triangular 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 and
is an (
) element vector.
and
are chosen to annihilate the elements of the
th row of
.
The vector
is returned in the
th element of the array
zeta and in the
th row of
a, such that
is in
and the elements of
are in
. The elements of
are returned in the upper triangular part of
a.
For further information on this factorization and its use see Section 6.5 of
Golub and Van Loan (1996).
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
upper trapezoidal 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
upper trapezoidal part of
a 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 .
Example
This example reduces the
by
matrix
to upper triangular form.
Open in the MATLAB editor:
f01qg_example
function f01qg_example
fprintf('f01qg example results\n\n');
a = [2.4, 0.8, -1.4, 3, -0.8;
0, 1.6, 0.8, 0.4, -0.8;
0, 0, 1, 2, 2];
[RQ, zeta, ifail] = f01qg(a);
disp('RQ Factorization of A');
disp('Vector zeta');
disp(zeta');
disp('Matrix A after factorization (R in left-hand upper triangle');
disp(RQ);
f01qg example results
RQ Factorization of A
Vector zeta
1.2649 1.3416 1.1547
Matrix A after factorization (R in left-hand upper triangle
-4.0000 -1.0000 -1.0000 0.6325 -0.0000
0 -2.0000 0.0000 0.0000 -0.4472
0 0 -3.0000 0.5774 0.5774
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015