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_zungbr (f08kt)

Purpose

nag_lapack_zungbr (f08kt) generates one of the complex unitary matrices QQ or PHPH which were determined by nag_lapack_zgebrd (f08ks) when reducing a complex matrix to bidiagonal form.

Syntax

[a, info] = f08kt(vect, k, a, tau, 'm', m, 'n', n)
[a, info] = nag_lapack_zungbr(vect, k, a, tau, 'm', m, 'n', n)

Description

nag_lapack_zungbr (f08kt) is intended to be used after a call to nag_lapack_zgebrd (f08ks), which reduces a complex rectangular matrix AA to real bidiagonal form BB by a unitary transformation: A = QBPHA=QBPH. nag_lapack_zgebrd (f08ks) represents the matrices QQ and PHPH as products of elementary reflectors.
This function may be used to generate QQ or PHPH explicitly as square matrices, or in some cases just the leading columns of QQ or the leading rows of PHPH.
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] = f08kt('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] = f08kt('Q', n, a(1:m,1:n), tau);
    
  3. To form the full nn by nn matrix PHPH:
    [a, info] = f08kt('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 PHPH:
    [a, info] = f08kt('P', m, a(1:m,1:n), 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 unitary matrix QQ or PHPH is generated.
vect = 'Q'vect='Q'
QQ is generated.
vect = 'P'vect='P'
PHPH 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, : :) – complex 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_zgebrd (f08ks).
4:     tau( : :) – complex 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_zgebrd (f08ks) 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 unitary matrix QQ or PHPH 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 unitary matrix QQ or PHPH 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, : :) – complex 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 unitary matrix QQ or PHPH, 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 unitary matrix by a matrix EE such that
E2 = O(ε) ,
E2 = O(ε) ,
where εε is the machine precision. A similar statement holds for the computed matrix PHPH.

Further Comments

The total number of real floating point operations for the cases listed in Section [Description] are approximately as follows:
  1. To form the whole of QQ:
    • (16/3)n(3m23mn + n2)163n(3m2-3mn+n2) if m > nm>n,
    • (16/3)m3163m3 if mnmn;
  2. To form the nn leading columns of QQ when m > nm>n:
    • (8/3)n2(3mn)83n2(3m-n);
  3. To form the whole of PHPH:
    • (16/3)n3163n3 if mnmn,
    • (16/3)m3(3n23mn + m2)163m3(3n2-3mn+m2) if m < nm<n;
  4. To form the mm leading rows of PHPH when m < nm<n:
    • (8/3)m2(3nm)83m2(3n-m).
The real analogue of this function is nag_lapack_dorgbr (f08kf).

Example

function nag_lapack_zungbr_example
vect = 'P';
k = int64(6);
a = [complex(-3.087005021051958),  2.112571007455839 + 0i, ...
    0.05433411079440312 + 0.4543118496773522i,  0.375743827925403 + 0.1070087304094524i;
      0 + 0i,  2.066039276679068 + 0i, ...
     1.262810106655224 + 0i,  0.02827717828732752 + 0.165005610304937i;
      0 + 0i,  0 + 0i,  1.873128891125711 + 0i,  -1.612633872800393 + 0i;
      0 + 0i,  0 + 0i,  0 + 0i,  2.002182866206992 + 0i];
tau = [ 1.231234531617602 - 0.5404263814542949i;
      1.262279868392228 - 0.928646196138089i;
      1.782899043025449 - 0.6221487671207239i;
      0 + 0i];
[aOut, info] = nag_lapack_zungbr(vect, k, a, tau)
 

aOut =

   1.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i  -0.2312 - 0.5404i   0.1786 - 0.5887i  -0.4048 - 0.3348i
   0.0000 + 0.0000i   0.4962 + 0.2648i  -0.3556 - 0.6888i   0.2757 - 0.0819i
   0.0000 + 0.0000i   0.2918 + 0.5030i   0.0485 + 0.1349i  -0.7156 - 0.3596i


info =

                    0


function f08kt_example
vect = 'P';
k = int64(6);
a = [complex(-3.087005021051958),  2.112571007455839 + 0i, ...
    0.05433411079440312 + 0.4543118496773522i,  0.375743827925403 + 0.1070087304094524i;
      0 + 0i,  2.066039276679068 + 0i, ...
     1.262810106655224 + 0i,  0.02827717828732752 + 0.165005610304937i;
      0 + 0i,  0 + 0i,  1.873128891125711 + 0i,  -1.612633872800393 + 0i;
      0 + 0i,  0 + 0i,  0 + 0i,  2.002182866206992 + 0i];
tau = [ 1.231234531617602 - 0.5404263814542949i;
      1.262279868392228 - 0.928646196138089i;
      1.782899043025449 - 0.6221487671207239i;
      0 + 0i];
[aOut, info] = f08kt(vect, k, a, tau)
 

aOut =

   1.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i  -0.2312 - 0.5404i   0.1786 - 0.5887i  -0.4048 - 0.3348i
   0.0000 + 0.0000i   0.4962 + 0.2648i  -0.3556 - 0.6888i   0.2757 - 0.0819i
   0.0000 + 0.0000i   0.2918 + 0.5030i   0.0485 + 0.1349i  -0.7156 - 0.3596i


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