PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dorgrq (f08cj)
Purpose
nag_lapack_dorgrq (f08cj) generates all or part of the real
by
orthogonal matrix
from an
factorization computed by
nag_lapack_dgerqf (f08ch).
Syntax
[
a,
info] = nag_lapack_dorgrq(
a,
tau, 'm',
m, 'n',
n, 'k',
k)
Description
nag_lapack_dorgrq (f08cj) is intended to be used following a call to
nag_lapack_dgerqf (f08ch), which performs an
factorization of a real matrix
and represents the orthogonal matrix
as a product of
elementary reflectors of order
.
This function may be used to generate explicitly as a square matrix, or to form only its trailing rows.
Usually
is determined from the
factorization of a
by
matrix
with
. The whole of
may be computed by:
[a, info] = f08cj(a, tau);
(note that the matrix
must have at least
rows), or its trailing
rows as:
[a, info] = f08cj(a(1:p,:), tau, 'k', p);
The rows of
returned by the last call form an orthonormal basis for the space spanned by the rows of
; thus
nag_lapack_dgerqf (f08ch) followed by
nag_lapack_dorgrq (f08cj) can be used to orthogonalize the rows of
.
The information returned by
nag_lapack_dgerqf (f08ch) also yields the
factorization of the trailing
rows of
, where
. The orthogonal matrix arising from this factorization can be computed by:
[a, info] = f08cj(a, tau, 'k', k);
or its leading
columns by:
[a, info] = f08cj(a(1:k,:), tau, 'k', k);
References
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
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
.
Details of the vectors which define the elementary reflectors, as returned by
nag_lapack_dgerqf (f08ch).
- 2:
– double array
-
The dimension of the array
tau
must be at least
must contain the scalar factor of the elementary reflector
, as returned by
nag_lapack_dgerqf (f08ch).
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a.
, the number of rows of the matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
a.
, the number of columns of the matrix .
Constraint:
.
- 3:
– int64int32nag_int scalar
-
Default:
the dimension of the array
tau.
, the number of elementary reflectors whose product defines 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 matrix .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
m, 2:
n, 3:
k, 4:
a, 5:
lda, 6:
tau, 7:
work, 8:
lwork, 9:
info.
It is possible that
info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
Accuracy
The computed matrix
differs from an exactly orthogonal matrix by a matrix
such that
and
is the
machine precision.
Further Comments
The total number of floating-point operations is approximately ; when this becomes .
The complex analogue of this function is
nag_lapack_zungrq (f08cw).
Example
This example generates the first four rows of the matrix
of the
factorization of
as returned by
nag_lapack_dgerqf (f08ch), where
Note that the block size (NB) of assumed in this example is not realistic for such a small problem, but should be suitable for large problems.
Open in the MATLAB editor:
f08cj_example
function f08cj_example
fprintf('f08cj example results\n\n');
a = [-0.57 -1.93 2.30 -1.93 0.15 -0.02;
-1.28 1.08 0.24 0.64 0.30 1.03;
-0.39 -0.31 0.40 -0.66 0.15 -1.43;
0.25 -2.14 -0.35 0.08 -2.13 0.50];
[rq, tau, info] = f08ch(a);
[Q, info] = f08cj(rq, tau);
disp('Orthogonal factor Q');
disp(Q);
f08cj example results
Orthogonal factor Q
-0.0833 0.2972 -0.6404 0.4461 -0.2938 -0.4575
0.9100 -0.1080 -0.2351 -0.1620 0.2022 -0.1946
-0.2202 -0.2706 0.2220 -0.3866 0.0015 -0.8243
-0.0809 0.6922 0.1132 -0.0259 0.6890 -0.1617
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015