hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_dormbr (f08kg)

Purpose

nag_lapack_dormbr (f08kg) multiplies an arbitrary real mm by nn matrix CC by one of the real orthogonal matrices QQ or PP 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 AA to bidiagonal form BB by an orthogonal transformation: A = QBPTA=QBPT. nag_lapack_dgebrd (f08ke) represents the matrices QQ and PTPT as products of elementary reflectors.
This function may be used to form one of the matrix products
QC , QTC , CQ , CQT , PC , PTC , CP ​ or ​ CPT ,
QC , QTC , CQ , CQT , PC , PTC , CP ​ or ​ CPT ,
overwriting the result on CC (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, rr denotes the order of QQ or PTPT: if side = 'L'side='L', r = mr=m and if side = 'R'side='R', r = nr=n.

Compulsory Input Parameters

1:     vect – string (length ≥ 1)
Indicates whether QQ or QTQT or PP or PTPT is to be applied to CC.
vect = 'Q'vect='Q'
QQ or QTQT is applied to CC.
vect = 'P'vect='P'
PP or PTPT is applied to CC.
Constraint: vect = 'Q'vect='Q' or 'P''P'.
2:     side – string (length ≥ 1)
Indicates how QQ or QTQT or PP or PTPT is to be applied to CC.
side = 'L'side='L'
QQ or QTQT or PP or PTPT is applied to CC from the left.
side = 'R'side='R'
QQ or QTQT or PP or PTPT is applied to CC from the right.
Constraint: side = 'L'side='L' or 'R''R'.
3:     trans – string (length ≥ 1)
Indicates whether QQ or PP or QTQT or PTPT is to be applied to CC.
trans = 'N'trans='N'
QQ or PP is applied to CC.
trans = 'T'trans='T'
QTQT or PTPT is applied to CC.
Constraint: trans = 'N'trans='N' or 'T''T'.
4:     k – int64int32nag_int scalar
If vect = 'Q'vect='Q', the number of columns in the original matrix AA.
If vect = 'P'vect='P', the number of rows in the original matrix AA.
Constraint: k0k0.
5:     a(lda, : :) – double array
The first dimension, lda, of the array a must satisfy
  • if vect = 'Q'vect='Q', lda max (1,r) lda max(1,r) ;
  • if vect = 'P'vect='P', lda max (1,min (r,k)) lda max(1,min(r,k)) .
The second dimension of the array must be at least max (1,min (r,k)) max(1,min(r,k))  if vect = 'Q'vect='Q' and at least max (1,r)max(1,r) if vect = 'P'vect='P'
Details of the vectors which define the elementary reflectors, as returned by nag_lapack_dgebrd (f08ke).
6:     tau( : :) – double array
Note: the dimension of the array tau must be at least max (1,min (r,k))max(1,min(r,k)).
Further details of the elementary reflectors, as returned by nag_lapack_dgebrd (f08ke) in its parameter tauq if vect = 'Q'vect='Q', or in its parameter taup if vect = 'P'vect='P'.
7:     c(ldc, : :) – double array
The first dimension of the array c must be at least max (1,m)max(1,m)
The second dimension of the array must be at least max (1,n)max(1,n)
The matrix CC.

Optional Input Parameters

1:     m – int64int32nag_int scalar
Default: The first dimension of the array c.
mm, the number of rows of the matrix CC.
Constraint: m0m0.
2:     n – int64int32nag_int scalar
Default: The second dimension of the array c.
nn, the number of columns of the matrix CC.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda ldc work lwork

Output Parameters

1:     c(ldc, : :) – double array
The first dimension of the array c will be max (1,m)max(1,m)
The second dimension of the array will be max (1,n)max(1,n)
ldcmax (1,m)ldcmax(1,m).
c stores QCQC or QTCQTC or CQCQ or CTQCTQ or PCPC or PTCPTC or CPCP or CTPCTP as specified by vect, side and trans.
2:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

  info = iinfo=-i
If info = iinfo=-i, parameter ii 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 EE such that
E2 = O(ε) C2 ,
E2 = O(ε) C2 ,
where εε is the machine precision.

Further Comments

The total number of floating point operations is approximately where kk is the value of the parameter k
The complex analogue of this function is nag_lapack_zunmbr (f08ku).

Example

function nag_lapack_dormbr_example
vect = 'Q';
side = 'Right';
trans = 'No transpose';
k = int64(4);
a = [3.61767881382524, 1.258711404710556, -0.4667885339706592, -0.4109505449290541;
     0, -2.416055340423328, -1.526154889941117, -0.2094556505641229;
     0, 0.02040919619839952, 1.921310963709999, 1.189466677019391;
     0, -0.3216264186905484, 0.1342281666124217, -1.426501541730861];
tau = [0;
     1.811823817941776;
     1.964603347174235;
     0];
c = [-0.1575595925823212, 0.6743815182091041, -0.4571499642152959, 0.4488516451198497;
     -0.5334912520769823, -0.3861089893314064, 0.2582527260774866, 0.3898174378676559;
     0.6357667770865594, -0.2928230899594127, 0.01653842638455846, 0.1929529167768124;
     -0.5334912520769823, -0.1691547055376643, -0.08342735451416805, -0.2349873193632054;
     0.04146305067955822, -0.1593027920340203, 0.1474783037934707, 0.7436407646419895;
     -0.005528406757274429, -0.5063529996817608, -0.83386806304906, 0.03351284255316388];
[cOut, info] = nag_lapack_dormbr(vect, side, trans, k, a, tau, c)
 

cOut =

   -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


info =

                    0


function f08kg_example
vect = 'Q';
side = 'Right';
trans = 'No transpose';
k = int64(4);
a = [3.61767881382524, 1.258711404710556, -0.4667885339706592, -0.4109505449290541;
     0, -2.416055340423328, -1.526154889941117, -0.2094556505641229;
     0, 0.02040919619839952, 1.921310963709999, 1.189466677019391;
     0, -0.3216264186905484, 0.1342281666124217, -1.426501541730861];
tau = [0;
     1.811823817941776;
     1.964603347174235;
     0];
c = [-0.1575595925823212, 0.6743815182091041, -0.4571499642152959, 0.4488516451198497;
     -0.5334912520769823, -0.3861089893314064, 0.2582527260774866, 0.3898174378676559;
     0.6357667770865594, -0.2928230899594127, 0.01653842638455846, 0.1929529167768124;
     -0.5334912520769823, -0.1691547055376643, -0.08342735451416805, -0.2349873193632054;
     0.04146305067955822, -0.1593027920340203, 0.1474783037934707, 0.7436407646419895;
     -0.005528406757274429, -0.5063529996817608, -0.83386806304906, 0.03351284255316388];
[cOut, info] = f08kg(vect, side, trans, k, a, tau, c)
 

cOut =

   -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


info =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013