PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_complex_gen_rq (f01rj)
Purpose
nag_matop_complex_gen_rq (f01rj) finds the factorization of the complex by (), matrix , so that is reduced to upper triangular form by means of unitary transformations from the right.
Syntax
Description
The
by
matrix
is factorized as
where
is an
by
unitary 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 for which
,
is a real scalar,
is a
element vector and
is an
element vector.
and
are chosen to annihilate the elements in the
th row of
.
The scalar
and the vector
are returned in the
th element of
theta and in the
th row of
a, such that
, given by
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:
– complex 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:
– complex 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:
– complex array
-
contains the scalar
for the
th transformation. If
then
; 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 unitary matrix
can be obtained by calling
nag_matop_complex_gen_rq_formq (f01rk), 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, theta);
Example
This example obtains the
factorization of the
by
matrix
Open in the MATLAB editor:
f01rj_example
function f01rj_example
fprintf('f01rj example results\n\n');
a = [ 0 - 0.5i, 0.4 - 0.3i, 0.4 + 0i, 0.3 + 0.4i, 0 + 0.3i;
-0.5 - 1.5i, 0.9 - 1.3i, -0.4 - 0.4i, 0.1 - 0.7i, 0.3 - 0.3i;
-1 - i, 0.2 - 1.4i, 1.8 + 0i, 0 + 0i, 0 - 2.4i];
[RQ, theta, ifail] = f01rj(a);
disp('RQ Factorization of A');
disp('Vector theta');
disp(theta');
disp('Matrix A after factorization (R in left-hand upper triangle');
disp(RQ);
f01rj example results
RQ Factorization of A
Vector theta
1.0387 + 0.1006i 1.1810 - 0.3809i 1.2244 + 0.0000i
Matrix A after factorization (R in left-hand upper triangle
0.7878 + 0.0000i -0.2549 - 0.4006i -0.2774 - 0.2774i -0.2850 + 0.5586i 0.1154 + 0.7031i
0.0396 + 0.5222i -2.1122 + 0.0000i -1.1094 - 0.5547i 0.1283 + 0.2317i 0.0790 - 0.0361i
-0.2265 + 0.2265i 0.0453 + 0.3171i -3.6056 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.5436i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015