nag_lapack_dormqr (f08ag) multiplies an arbitrary real matrix
by the real orthogonal matrix
from a
factorization computed by
nag_lapack_dgeqrf (f08ae),
nag_lapack_dgeqpf (f08be) or
nag_lapack_dgeqp3 (f08bf).
nag_lapack_dormqr (f08ag) is intended to be used after a call to
nag_lapack_dgeqrf (f08ae),
nag_lapack_dgeqpf (f08be) or
nag_lapack_dgeqp3 (f08bf) which perform a
factorization of a real matrix
. The orthogonal matrix
is represented as a product of elementary reflectors.
This function may be used to form one of the matrix products
overwriting the result on
(which may be any real rectangular matrix).
A common application of this function is in solving linear least squares problems, as described in the
F08 Chapter Introduction and illustrated in
Example in
nag_lapack_dgeqrf (f08ae).
The computed result differs from the exact result by a matrix
such that
where
is the
machine precision.
The complex analogue of this function is
nag_lapack_zunmqr (f08au).
function f08ag_example
fprintf('f08ag example results\n\n');
a = [-0.57, -1.28, -0.39, 0.25;
-1.93, 1.08, -0.31, -2.14;
2.30, 0.24, 0.40, -0.35;
-1.93, 0.64, -0.66, 0.08;
0.15, 0.30, 0.15, -2.13;
-0.02, 1.03, -1.43, 0.50];
[a, tau, info] = f08ae(a);
side = 'Left';
trans = 'Transpose';
c = [-2.67, 0.41;
-0.55, -3.10;
3.34, -4.01;
-0.77, 2.76;
0.48, -6.17;
4.10, 0.21];
[b, info] = f08ag(side, trans, a, tau, c);
disp('B = Q^T*C:');
disp(b);