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_zungqr (f08at)

Purpose

nag_lapack_zungqr (f08at) generates all or part of the complex unitary matrix QQ from a QRQR factorization computed by nag_lapack_zgeqrf (f08as), nag_lapack_zgeqpf (f08bs) or nag_lapack_zgeqp3 (f08bt).

Syntax

[a, info] = f08at(a, tau, 'm', m, 'n', n, 'k', k)
[a, info] = nag_lapack_zungqr(a, tau, 'm', m, 'n', n, 'k', k)

Description

nag_lapack_zungqr (f08at) is intended to be used after a call to nag_lapack_zgeqrf (f08as), nag_lapack_zgeqpf (f08bs) or nag_lapack_zgeqp3 (f08bt), which perform a QRQR factorization of a complex matrix AA. The unitary matrix QQ is represented as a product of elementary reflectors.
This function may be used to generate QQ explicitly as a square matrix, or to form only its leading columns.
Usually QQ is determined from the QRQR factorization of an mm by pp matrix AA with mpmp. The whole of QQ may be computed by:
[a, info] = f08at(a, tau);
(note that the array a must have mm columns) or its leading pp columns by:
[a, info] = f08at(a(1:p,:), tau);
The columns of QQ returned by the last call form an orthonormal basis for the space spanned by the columns of AA; thus nag_lapack_zgeqrf (f08as) followed by nag_lapack_zungqr (f08at) can be used to orthogonalize the columns of AA.
The information returned by the QRQR factorization functions also yields the QRQR factorization of the leading kk columns of AA, where k < pk<p. The unitary matrix arising from this factorization can be computed by:
[a, info] = f08at(a, tau);
or its leading kk columns by:
[a, info] = f08at(a(:,1:k), 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:     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_zgeqrf (f08as), nag_lapack_zgeqpf (f08bs) or nag_lapack_zgeqp3 (f08bt).
2:     tau( : :) – complex array
Note: the dimension of the array tau must be at least max (1,k)max(1,k).
Further details of the elementary reflectors, as returned by nag_lapack_zgeqrf (f08as), nag_lapack_zgeqpf (f08bs) or nag_lapack_zgeqp3 (f08bt).

Optional Input Parameters

1:     m – int64int32nag_int scalar
Default: The first dimension of the array a.
mm, the order of the unitary matrix QQ.
Constraint: m0m0.
2:     n – int64int32nag_int scalar
Default: The second dimension of the array a.
nn, the number of columns of the matrix QQ.
Constraint: mn0mn0.
3:     k – int64int32nag_int scalar
Default: The dimension of the array tau.
kk, the number of elementary reflectors whose product defines the matrix QQ.
Constraint: nk0nk0.

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 mm by nn matrix QQ.
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: m, 2: n, 3: k, 4: a, 5: lda, 6: tau, 7: work, 8: lwork, 9: 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.

Further Comments

The total number of real floating point operations is approximately 16mnk8 (m + n) k2 + (16/3) k3 16mnk-8 (m+n) k2 + 163 k3 ; when n = kn=k, the number is approximately (8/3) n2 (3mn) 83 n2 (3m-n) .
The real analogue of this function is nag_lapack_dorgqr (f08af).

Example

function nag_lapack_zungqr_example
a = [-3.087005021051958,  -0.4884993674179767 - 1.141689105124614i, ...
     0.3773560431732106 - 1.243729755480491i,  -0.8551654376967619 - 0.7073198731811355i;
      -0.326978431123342 + 0.4238066080640211i, ...
    1.516316047290931 + 0i,  1.373055096626977 - 0.8176293354211591i,  -0.2508627202628476 + 0.8203486040451443i;
      0.1691724764304651 - 0.07980476733072399i, ...
    -0.4537104861498296 - 0.006491499591352979i,  -2.17134536255717 + 0i,  -0.2272676203283603 - 0.2957314059070643i;
      -0.1059736295130279 + 0.0726861860966964i, ...
    -0.2734071741396468 + 0.0978078838704349i,  -0.291822737804996 + 0.4888081441553061i,  -2.353376106555421 + 0i;
      0.1729396325459321 + 0.1606326404292985i, ...
    -0.3236304714632618 + 0.1230007002199739i,  0.2727685061644792 + 0.04697693306903757i, ...
      0.7054226886031557 + 0.2515080566109891i;
      0.2698996744687472 - 0.01516708364852971i, ...
    -0.1645935439354584 + 0.3389007203482612i,  0.5348395253617789 + 0.3988290677840221i, ...
      0.2703069905230761 - 0.07268783264065712i];
tau = [ 1.310981029656006 - 0.2623902437722555i;
      1.105103989110574 - 0.450362538745018i;
      1.040251871615519 + 0.2121758107261096i;
      1.18595901116611 + 0.2011836003307436i];
[aOut, info] = nag_lapack_zungqr(a, tau)
 

aOut =

  -0.3110 + 0.2624i  -0.3175 + 0.4835i   0.4966 - 0.2997i  -0.0072 - 0.3718i
   0.3175 - 0.6414i  -0.2062 + 0.1577i  -0.0793 - 0.3094i  -0.0282 - 0.1491i
  -0.2008 + 0.1490i   0.4892 - 0.0900i   0.0357 - 0.0219i   0.5625 - 0.0710i
   0.1199 - 0.1231i   0.2566 - 0.3055i   0.4489 - 0.2141i  -0.1651 + 0.1800i
  -0.2689 - 0.1652i   0.1697 - 0.2491i  -0.0496 + 0.1158i  -0.4885 - 0.4540i
  -0.3499 + 0.0907i  -0.0491 - 0.3133i  -0.1256 - 0.5300i   0.1039 + 0.0450i


info =

                    0


function f08at_example
a = [-3.087005021051958,  -0.4884993674179767 - 1.141689105124614i, ...
     0.3773560431732106 - 1.243729755480491i, ...
     -0.8551654376967619 - 0.7073198731811355i;
      -0.326978431123342 + 0.4238066080640211i, ...
    1.516316047290931 + 0i,  1.373055096626977 - 0.8176293354211591i, ...
    -0.2508627202628476 + 0.8203486040451443i;
      0.1691724764304651 - 0.07980476733072399i, ...
    -0.4537104861498296 - 0.006491499591352979i,  -2.17134536255717 + 0i, ...
     -0.2272676203283603 - 0.2957314059070643i;
      -0.1059736295130279 + 0.0726861860966964i, ...
    -0.2734071741396468 + 0.0978078838704349i, ...
     -0.291822737804996 + 0.4888081441553061i,  -2.353376106555421 + 0i;
      0.1729396325459321 + 0.1606326404292985i, ...
    -0.3236304714632618 + 0.1230007002199739i,  ...
     0.2727685061644792 + 0.04697693306903757i, ...
      0.7054226886031557 + 0.2515080566109891i;
      0.2698996744687472 - 0.01516708364852971i, ...
    -0.1645935439354584 + 0.3389007203482612i,  ...
      0.5348395253617789 + 0.3988290677840221i, ...
      0.2703069905230761 - 0.07268783264065712i];
tau = [ 1.310981029656006 - 0.2623902437722555i;
      1.105103989110574 - 0.450362538745018i;
      1.040251871615519 + 0.2121758107261096i;
      1.18595901116611 + 0.2011836003307436i];
[aOut, info] = f08at(a, tau)
 

aOut =

  -0.3110 + 0.2624i  -0.3175 + 0.4835i   0.4966 - 0.2997i  -0.0072 - 0.3718i
   0.3175 - 0.6414i  -0.2062 + 0.1577i  -0.0793 - 0.3094i  -0.0282 - 0.1491i
  -0.2008 + 0.1490i   0.4892 - 0.0900i   0.0357 - 0.0219i   0.5625 - 0.0710i
   0.1199 - 0.1231i   0.2566 - 0.3055i   0.4489 - 0.2141i  -0.1651 + 0.1800i
  -0.2689 - 0.1652i   0.1697 - 0.2491i  -0.0496 + 0.1158i  -0.4885 - 0.4540i
  -0.3499 + 0.0907i  -0.0491 - 0.3133i  -0.1256 - 0.5300i   0.1039 + 0.0450i


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