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_zungrq (f08cw)

Purpose

nag_lapack_zungrq (f08cw) generates all or part of the complex nn by nn unitary matrix QQ from an RQRQ factorization computed by nag_lapack_zgerqf (f08cv).

Syntax

[a, info] = f08cw(a, tau, 'm', m, 'n', n, 'k', k)
[a, info] = nag_lapack_zungrq(a, tau, 'm', m, 'n', n, 'k', k)

Description

nag_lapack_zungrq (f08cw) is intended to be used following a call to nag_lapack_zgerqf (f08cv), which performs an RQRQ factorization of a complex matrix AA and represents the unitary matrix QQ as a product of kk elementary reflectors of order nn.
This function may be used to generate QQ explicitly as a square matrix, or to form only its trailing rows.
Usually QQ is determined from the RQRQ factorization of a pp by nn matrix AA with pnpn. The whole of QQ may be computed by:
[a, info] = f08cw(a, tau);
(note that the matrix AA must have at least nn rows), or its trailing pp rows as:
[a, info] = f08cw(a(1:p,:), tau, 'k', p);
The rows of QQ returned by the last call form an orthonormal basis for the space spanned by the rows of AA; thus nag_lapack_zgerqf (f08cv) followed by nag_lapack_zungrq (f08cw) can be used to orthogonalize the rows of AA.
The information returned by nag_lapack_zgerqf (f08cv) also yields the RQRQ factorization of the trailing kk rows of AA, where k < pk<p. The unitary matrix arising from this factorization can be computed by:
[a, info] = f08cw(a, tau, 'k', k);
or its leading kk columns by:
[a, info] = f08cw(a(1:k,:), tau, 'k', k);

References

Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia http://www.netlib.org/lapack/lug
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_zgerqf (f08cv).
2:     tau( : :) – complex array
Note: the dimension of the array tau must be at least max (1,k)max(1,k).
tau(i)taui must contain the scalar factor of the elementary reflector HiHi, as returned by nag_lapack_zgerqf (f08cv).

Optional Input Parameters

1:     m – int64int32nag_int scalar
Default: The first dimension of the array a.
mm, the number of rows of the 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: nmnm.
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: mk0mk0.

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ε
and εε is the machine precision.

Further Comments

The total number of floating point operations is approximately 16mnk8(m + n)k2 + (16/3)k316mnk-8(m+n)k2+163k3; when m = km=k this becomes (8/3)m2(3nm)83m2(3n-m).
The real analogue of this function is nag_lapack_dorgrq (f08cj).

Example

function nag_lapack_zungrq_example
a = [ -0.1732849729587456 - 0.353512300439208i, ...
    -0.2462313258920653 + 0.2360567043400598i,  -1.835343413987657 + 0i, ...
    -1.000908232487384 + 1.32039822375845i,  0.4156798554945925 + 1.306842647249796i, ...
      -0.9547699266414058 + 0.7897042065311224i;
      0.09114631819652763 + 0.2475043484243413i, ...
    -0.4802181323902914 - 0.1420168005324323i,  0.4821546631632406 - 0.09601786537269767i, ...
     -1.575493318887248 + 0i,  -1.101370732269467 - 0.05966135311459431i, ...
      -0.3055741168299267 + 0.2217392484654139i;
      -0.3728300824744412 + 0.4958059927232391i, ...
    -0.1765491709076989 + 0.1573286421732319i,  0.21466822640392 + 0.1362481009678133i, ...
     -0.2486033881873816 - 0.20517929204053i, ...
     -2.991745620440206 + 0i,  -0.01276691481133434 + 0.08423270423682098i;
      -0.004843574322500398 + 0.1359553259506703i, ...
    -0.2500132710791688 + 0.2066154899636792i,  -0.3473326302453916 + 0.2282035599626739i, ...
     0.06655374884663712 - 0.0718369909305264i, ...
     0.5272403281091034 + 0.480309771000454i,  -2.764959312539698 + 0i];
tau = [ 1.56428134034193 + 0.1176469112365368i;
      1.251296240416963 + 0.1907664156695332i;
      1.137210468449182 + 0.3464883871917274i;
      1.094033933454587 - 0.09403393345458752i];
[aOut, info] = nag_lapack_zungrq(a, tau)
 

aOut =

  Columns 1 through 5

   0.2810 + 0.5020i   0.2707 - 0.3296i  -0.2864 - 0.0094i   0.2262 - 0.3854i   0.0341 - 0.0760i
  -0.2051 - 0.1092i   0.5711 + 0.0432i  -0.5416 + 0.0454i  -0.3387 + 0.2228i   0.0098 - 0.0712i
   0.3083 - 0.6874i   0.2251 - 0.1313i  -0.2062 + 0.0691i   0.3259 + 0.1178i   0.0753 + 0.1412i
   0.0181 - 0.1483i   0.2930 - 0.2025i   0.4015 - 0.2170i  -0.0796 + 0.0723i  -0.5317 - 0.5751i

  Column 6

  -0.3936 - 0.2083i
  -0.1296 + 0.3691i
   0.0264 - 0.4134i
  -0.0940 - 0.0940i


info =

                    0


function f08cw_example
a = [ -0.1732849729587456 - 0.353512300439208i, ...
    -0.2462313258920653 + 0.2360567043400598i,  -1.835343413987657 + 0i, ...
    -1.000908232487384 + 1.32039822375845i,  0.4156798554945925 + 1.306842647249796i, ...
      -0.9547699266414058 + 0.7897042065311224i;
      0.09114631819652763 + 0.2475043484243413i, ...
    -0.4802181323902914 - 0.1420168005324323i,  0.4821546631632406 - 0.09601786537269767i, ...
     -1.575493318887248 + 0i,  -1.101370732269467 - 0.05966135311459431i, ...
      -0.3055741168299267 + 0.2217392484654139i;
      -0.3728300824744412 + 0.4958059927232391i, ...
    -0.1765491709076989 + 0.1573286421732319i,  0.21466822640392 + 0.1362481009678133i, ...
     -0.2486033881873816 - 0.20517929204053i, ...
     -2.991745620440206 + 0i,  -0.01276691481133434 + 0.08423270423682098i;
      -0.004843574322500398 + 0.1359553259506703i, ...
    -0.2500132710791688 + 0.2066154899636792i,  -0.3473326302453916 + 0.2282035599626739i, ...
     0.06655374884663712 - 0.0718369909305264i, ...
     0.5272403281091034 + 0.480309771000454i,  -2.764959312539698 + 0i];
tau = [ 1.56428134034193 + 0.1176469112365368i;
      1.251296240416963 + 0.1907664156695332i;
      1.137210468449182 + 0.3464883871917274i;
      1.094033933454587 - 0.09403393345458752i];
[aOut, info] = f08cw(a, tau)
 

aOut =

  Columns 1 through 5

   0.2810 + 0.5020i   0.2707 - 0.3296i  -0.2864 - 0.0094i   0.2262 - 0.3854i   0.0341 - 0.0760i
  -0.2051 - 0.1092i   0.5711 + 0.0432i  -0.5416 + 0.0454i  -0.3387 + 0.2228i   0.0098 - 0.0712i
   0.3083 - 0.6874i   0.2251 - 0.1313i  -0.2062 + 0.0691i   0.3259 + 0.1178i   0.0753 + 0.1412i
   0.0181 - 0.1483i   0.2930 - 0.2025i   0.4015 - 0.2170i  -0.0796 + 0.0723i  -0.5317 - 0.5751i

  Column 6

  -0.3936 - 0.2083i
  -0.1296 + 0.3691i
   0.0264 - 0.4134i
  -0.0940 - 0.0940i


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