PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dormbr (f08kg)
Purpose
nag_lapack_dormbr (f08kg) multiplies an arbitrary real
by
matrix
by one of the real orthogonal matrices
or
which were determined by
nag_lapack_dgebrd (f08ke) when reducing a real matrix to bidiagonal form.
Syntax
[
c,
info] = f08kg(
vect,
side,
trans,
k,
a,
tau,
c, 'm',
m, 'n',
n)
[
c,
info] = nag_lapack_dormbr(
vect,
side,
trans,
k,
a,
tau,
c, 'm',
m, 'n',
n)
Description
nag_lapack_dormbr (f08kg) is intended to be used after a call to
nag_lapack_dgebrd (f08ke), which reduces a real rectangular matrix
to bidiagonal form
by an orthogonal transformation:
.
nag_lapack_dgebrd (f08ke) represents the matrices
and
as products 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).
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Note: in the descriptions below, denotes the order of or : if , and if , .
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates whether
or
or
or
is to be applied to
.
- or is applied to .
- or is applied to .
Constraint:
or .
- 2:
– string (length ≥ 1)
-
Indicates how
or
or
or
is to be applied to
.
- or or or is applied to from the left.
- or or or is applied to from the right.
Constraint:
or .
- 3:
– string (length ≥ 1)
-
Indicates whether
or
or
or
is to be applied to
.
- or is applied to .
- or is applied to .
Constraint:
or .
- 4:
– int64int32nag_int scalar
-
If
, the number of columns in the original matrix
.
If , the number of rows in the original matrix .
Constraint:
.
- 5:
– double array
-
The first dimension,
, of the array
a must satisfy
- if , ;
- if , .
The second dimension of the array
a must be at least
if
and at least
if
.
Details of the vectors which define the elementary reflectors, as returned by
nag_lapack_dgebrd (f08ke).
- 6:
– double array
-
The dimension of the array
tau
must be at least
Further details of the elementary reflectors, as returned by
nag_lapack_dgebrd (f08ke) in its argument
tauq if
, or in its argument
taup if
.
- 7:
– double array
-
The first dimension of the array
c must be at least
.
The second dimension of the array
c must be at least
.
The matrix .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
c.
, the number of rows of the matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the second dimension of the array
c.
, the number of columns of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
The first dimension of the array
c will be
.
The second dimension of the array
c will be
.
c stores
or
or
or
or
or
or
or
as specified by
vect,
side and
trans.
- 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:
vect, 2:
side, 3:
trans, 4:
m, 5:
n, 6:
k, 7:
a, 8:
lda, 9:
tau, 10:
c, 11:
ldc, 12:
work, 13:
lwork, 14:
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 result differs from the exact result by a matrix
such that
where
is the
machine precision.
Further Comments
The total number of floating-point operations is approximately
- if and , ;
- if and , ;
- if and , ;
- if and , ,
where
is the value of the argument
kThe complex analogue of this function is
nag_lapack_zunmbr (f08ku).
Example
For this function two examples are presented. Both illustrate how the reduction to bidiagonal form of a matrix may be preceded by a or factorization of .
In the first example,
, and
The function first performs a
factorization of
as
and then reduces the factor
to bidiagonal form
:
. Finally it forms
and calls
nag_lapack_dormbr (f08kg) to form
.
In the second example,
, and
The function first performs an
factorization of
as
and then reduces the factor
to bidiagonal form
:
. Finally it forms
and calls
nag_lapack_dormbr (f08kg) to form
.
Open in the MATLAB editor:
f08kg_example
function f08kg_example
fprintf('f08kg example results\n\n');
ex1;
ex2;
function ex1
m = 6;
n = int64(4);
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];
[QR, tau, info] = f08ae(a);
[Q, info] = f08af(QR, tau);
R = triu(QR(1:n,1:n));
[B, d, e, tauq, taup, info] = ...
f08ke(R);
vect = 'Q';
side = 'Right';
trans = 'No transpose';
[Q2, info] = f08kg( ...
vect, side, trans, n, B, tauq, Q);
fprintf('Example 1: bidiagonal matrix B\n Main diagonal ');
fprintf(' %7.3f',d);
fprintf('\n super-diagonal ');
fprintf(' %7.3f',e);
fprintf('\n\n');
disp('Example 1: Orthogonal matrix Q');
disp(Q2);
function ex2
m = int64(4);
n = int64(6);
a = [ -5.42 3.28 -3.68 0.27 2.06 0.46;
-1.65 -3.40 -3.20 -1.03 -4.06 -0.01;
-0.37 2.35 1.90 4.31 -1.76 1.13;
-3.15 -0.11 1.99 -2.70 0.26 4.50];
[LQ, tau, info] = f08ah(a);
[Q, info] = f08aj(LQ, tau);
L = tril(LQ(1:m,1:m));
[B, d, e, tauq, taup, info] = ...
f08ke(L);
vect = 'P';
side = 'Left';
trans = 'Transpose';
[P2, info] = f08kg( ...
vect, side, trans, n, B, taup, Q);
fprintf('Example 2: bidiagonal matrix B\n Main diagonal ');
fprintf(' %7.3f',d);
fprintf('\n super-diagonal ');
fprintf(' %7.3f',e);
fprintf('\n\n');
disp('Example 2: Orthogonal matrix P^T');
disp(P2);
f08kg example results
Example 1: bidiagonal matrix B
Main diagonal 3.618 -2.416 1.921 -1.427
super-diagonal 1.259 -1.526 1.189
Example 1: Orthogonal matrix Q
-0.1576 -0.2690 0.2612 0.8513
-0.5335 0.5311 -0.2922 0.0184
0.6358 0.3495 -0.0250 -0.0210
-0.5335 0.0035 0.1537 -0.2592
0.0415 0.5572 -0.2917 0.4523
-0.0055 0.4614 0.8585 -0.0532
Example 2: bidiagonal matrix B
Main diagonal -7.772 6.157 -6.058 5.793
super-diagonal 1.193 0.573 -1.914
Example 2: Orthogonal matrix P^T
-0.7104 0.4299 -0.4824 0.0354 0.2700 0.0603
0.3583 0.1382 -0.4110 0.4044 0.0951 -0.7148
-0.0507 0.4244 0.3795 0.7402 -0.2773 0.2203
0.2442 0.4016 0.4158 -0.1354 0.7666 -0.0137
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015