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_dorgbr (f08kf)

Purpose

nag_lapack_dorgbr (f08kf) generates one of the real orthogonal matrices QQ or PTPT which were determined by nag_lapack_dgebrd (f08ke) when reducing a real matrix to bidiagonal form.

Syntax

[a, info] = f08kf(vect, k, a, tau, 'm', m, 'n', n)
[a, info] = nag_lapack_dorgbr(vect, k, a, tau, 'm', m, 'n', n)

Description

nag_lapack_dorgbr (f08kf) 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 generate QQ or PTPT explicitly as square matrices, or in some cases just the leading columns of QQ or the leading rows of PTPT.
The various possibilities are specified by the parameters vect, m, n and k. The appropriate values to cover the most likely cases are as follows (assuming that AA was an mm by nn matrix):
  1. To form the full mm by mm matrix QQ:
    [a, info] = f08kf('Q', n, a, tau);
    
    (note that the array a must have at least mm columns).
  2. If m > nm>n, to form the nn leading columns of QQ:
    [a, info] = f08kf('Q', n, a, tau);
    
  3. To form the full nn by nn matrix PTPT:
    [a, info] = f08kf('P', m, a, tau);
    
    (note that the array a must have at least nn rows).
  4. If m < nm<n, to form the mm leading rows of PTPT:
    [a, info] = f08kf('P', m, a, tau);
    

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     vect – string (length ≥ 1)
Indicates whether the orthogonal matrix QQ or PTPT is generated.
vect = 'Q'vect='Q'
QQ is generated.
vect = 'P'vect='P'
PTPT is generated.
Constraint: vect = 'Q'vect='Q' or 'P''P'.
2:     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.
3:     a(lda, : :) – double array
The first dimension of the array a 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)
Details of the vectors which define the elementary reflectors, as returned by nag_lapack_dgebrd (f08ke).
4:     tau( : :) – double array
Note: the dimension of the array tau must be at least max (1,min (m,k))max(1,min(m,k)) if vect = 'Q'vect='Q' and at least max (1,min (n,k))max(1,min(n,k)) if vect = 'P'vect='P'.
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'.

Optional Input Parameters

1:     m – int64int32nag_int scalar
Default: The first dimension of the array a.
mm, the number of rows of the orthogonal matrix QQ or PTPT to be returned.
Constraint: m0m0.
2:     n – int64int32nag_int scalar
Default: The second dimension of the array a.
nn, the number of columns of the orthogonal matrix QQ or PTPT to be returned.
Constraints:
  • n0n0;
  • if vect = 'Q'vect='Q' and m > km>k, mnkmnk;
  • if vect = 'Q'vect='Q' and mkmk, m = nm=n;
  • if vect = 'P'vect='P' and n > kn>k, nmknmk;
  • if vect = 'P'vect='P' and nknk, n = mn=m.

Input Parameters Omitted from the MATLAB Interface

lda work lwork

Output Parameters

1:     a(lda, : :) – double array
The first dimension of the array a will be max (1,m)max(1,m)
The second dimension of the array will be max (1,n)max(1,n)
ldamax (1,m)ldamax(1,m).
The orthogonal matrix QQ or PTPT, or the leading rows or columns thereof, as specified by vect, m and n.
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: m, 3: n, 4: k, 5: a, 6: lda, 7: tau, 8: work, 9: lwork, 10: 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 QQ differs from an exactly orthogonal matrix by a matrix EE such that
E2 = O(ε) ,
E2 = O(ε) ,
where εε is the machine precision. A similar statement holds for the computed matrix PTPT.

Further Comments

The total number of floating point operations for the cases listed in Section [Description] are approximately as follows:
  1. To form the whole of QQ:
    • (4/3)n(3m23mn + n2)43n(3m2-3mn+n2) if m > nm>n,
    • (4/3)m343m3 if mnmn;
  2. To form the nn leading columns of QQ when m > nm>n:
    • (2/3) n2 (3mn) 23 n2 (3m-n) ;
  3. To form the whole of PTPT:
    • (4/3)n343n3 if mnmn,
    • (4/3)m(3n23mn + m2)43m(3n2-3mn+m2) if m < nm<n;
  4. To form the mm leading rows of PTPT when m < nm<n:
    • (2/3) m2 (3nm) 23 m2 (3n-m) .
The complex analogue of this function is nag_lapack_zungbr (f08kt).

Example

function nag_lapack_dorgbr_example
vect = 'P';
k = int64(6);
a = [-0.57, -1.28, -0.39,  0.25;
     -1.93,  1.08, -0.31, -2.14;
      2.3,   0.24,  0.4,  -0.35;
     -1.93,  0.64, -0.66,  0.08;
      0.15,  0.3,   0.15, -2.13;
     -0.02,  1.03, -1.43,  0.5];
tau = [1.442198259457561;
     1.915944323746201;
     0;
     0];
[a, d, e, tauq, taup, info] = nag_lapack_dgebrd(a);
[aOut, info] = nag_lapack_dorgbr(vect, k, a(1:4, :), taup)
 

aOut =

    1.0000         0         0         0
         0   -0.4422    0.6732    0.5927
         0   -0.3788   -0.7391    0.5570
         0    0.8130    0.0218    0.5818


info =

                    0


function f08kf_example
vect = 'P';
k = int64(6);
a = [-0.57, -1.28, -0.39,  0.25;
     -1.93,  1.08, -0.31, -2.14;
      2.3,   0.24,  0.4,  -0.35;
     -1.93,  0.64, -0.66,  0.08;
      0.15,  0.3,   0.15, -2.13;
     -0.02,  1.03, -1.43,  0.5];
tau = [1.442198259457561;
     1.915944323746201;
     0;
     0];
[a, d, e, tauq, taup, info] = f08ke(a);
[aOut, info] = f08kf(vect, k, a(1:4, :), taup)
 

aOut =

    1.0000         0         0         0
         0   -0.4422    0.6732    0.5927
         0   -0.3788   -0.7391    0.5570
         0    0.8130    0.0218    0.5818


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