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_zunmqr (f08au)

Purpose

nag_lapack_zunmqr (f08au) multiplies an arbitrary complex matrix CC by 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

[c, info] = f08au(side, trans, a, tau, c, 'm', m, 'n', n, 'k', k)
[c, info] = nag_lapack_zunmqr(side, trans, a, tau, c, 'm', m, 'n', n, 'k', k)

Description

nag_lapack_zunmqr (f08au) 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 form one of the matrix products
QC , QHC , CQ ​ or ​ CQH ,
QC , QHC , CQ ​ or ​ CQH ,
overwriting the result on cc (which may be any complex rectangular matrix).
A common application of this function is in solving linear least squares problems, as described in the F08 Chapter Introduction and illustrated in Section [Example] in (f08as).

References

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

Parameters

Compulsory Input Parameters

1:     side – string (length ≥ 1)
Indicates how QQ or QHQH is to be applied to CC.
side = 'L'side='L'
QQ or QHQH is applied to CC from the left.
side = 'R'side='R'
QQ or QHQH is applied to CC from the right.
Constraint: side = 'L'side='L' or 'R''R'.
2:     trans – string (length ≥ 1)
Indicates whether QQ or QHQH is to be applied to CC.
trans = 'N'trans='N'
QQ is applied to CC.
trans = 'C'trans='C'
QHQH is applied to CC.
Constraint: trans = 'N'trans='N' or 'C''C'.
3:     a(lda, : :) – complex array
The first dimension, lda, of the array a must satisfy
  • if side = 'L'side='L', lda max (1,m) lda max(1,m) ;
  • if side = 'R'side='R', lda max (1,n) lda max(1,n) .
The second dimension of the array must be at least max (1,k)max(1,k)
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).
4:     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).
5:     c(ldc, : :) – complex 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 mm by nn 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.
3:     k – int64int32nag_int scalar
Default: The second dimension of the arrays a, tau.
kk, the number of elementary reflectors whose product defines the matrix QQ.
Constraints:
  • if side = 'L'side='L', m k 0 m k 0 ;
  • if side = 'R'side='R', n k 0 n k 0 .

Input Parameters Omitted from the MATLAB Interface

lda ldc work lwork

Output Parameters

1:     c(ldc, : :) – complex 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 QHCQHC or CQCQ or CQHCQH as specified by 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: side, 2: trans, 3: m, 4: n, 5: k, 6: a, 7: lda, 8: tau, 9: c, 10: ldc, 11: work, 12: lwork, 13: 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 real floating point operations is approximately 8nk (2mk) 8nk (2m-k)  if side = 'L'side='L' and 8mk (2nk) 8mk (2n-k)  if side = 'R'side='R'.
The real analogue of this function is nag_lapack_dormqr (f08ag).

Example

function nag_lapack_zunmqr_example
side = 'Left';
trans = 'Conjugate transpose';
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];
c = [ -2.09 + 1.93i,  3.26 - 2.7i;
      3.34 - 3.53i,  -6.22 + 1.16i;
      -4.94 - 2.04i,  7.94 - 3.13i;
      0.17 + 4.23i,  1.04 - 4.26i;
      -5.19 + 3.63i,  -2.31 - 2.12i;
      0.98 + 2.53i,  -1.39 - 4.05i];
[cOut, info] = nag_lapack_zunmqr(side, trans, a, tau, c)
 

cOut =

   5.3510 - 0.1638i  -4.7626 - 2.8427i
  -5.7559 - 0.2004i   6.3325 - 2.7406i
  -2.5366 + 4.0215i   6.4835 - 3.8629i
  -1.0677 - 6.3316i   6.4968 - 0.7809i
  -0.0381 - 0.0273i  -0.1320 - 0.0612i
  -0.0144 + 0.0483i   0.0906 - 0.0740i


info =

                    0


function f08au_example
side = 'Left';
trans = 'Conjugate transpose';
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];
c = [ -2.09 + 1.93i,  3.26 - 2.7i;
      3.34 - 3.53i,  -6.22 + 1.16i;
      -4.94 - 2.04i,  7.94 - 3.13i;
      0.17 + 4.23i,  1.04 - 4.26i;
      -5.19 + 3.63i,  -2.31 - 2.12i;
      0.98 + 2.53i,  -1.39 - 4.05i];
[cOut, info] = f08au(side, trans, a, tau, c)
 

cOut =

   5.3510 - 0.1638i  -4.7626 - 2.8427i
  -5.7559 - 0.2004i   6.3325 - 2.7406i
  -2.5366 + 4.0215i   6.4835 - 3.8629i
  -1.0677 - 6.3316i   6.4968 - 0.7809i
  -0.0381 - 0.0273i  -0.1320 - 0.0612i
  -0.0144 + 0.0483i   0.0906 - 0.0740i


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