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_matop_complex_gen_rq_formq (f01rk)

Purpose

nag_matop_complex_gen_rq_formq (f01rk) returns the first  rows of the nn by nn unitary matrix PHPH, where PP is given as the product of Householder transformation matrices.
This function is intended for use following nag_matop_complex_gen_rq (f01rj).

Syntax

[a, ifail] = f01rk(wheret, m, nrowp, a, theta, 'n', n)
[a, ifail] = nag_matop_complex_gen_rq_formq(wheret, m, nrowp, a, theta, 'n', n)

Description

PP is assumed to be given by
P = Pm Pm1 P1 ,
P = Pm P m-1 P1 ,
where
Pk=I-γkukukH, uk= wk ζk 0 zk
Pk = I − γkukukH,
uk = ( wk ζk 0 zk )
γkγk is a scalar for which Re(γk) = 1.0Re(γk)=1.0, ζkζk is a real scalar, wkwk is a (k1)(k-1) element vector and zkzk is an (nm)(n-m) element vector. wkwk must be supplied in the kkth row of a in elements a(k,1),,a(k,k1)ak1,,akk-1. zkzk must be supplied in the kkth row of a in elements a(k,m + 1),,a(k,n)akm+1,,akn and θkθk, given by
θk = (ζk,Im(γk)),
θk=(ζk,Im(γk)),
must be supplied either in a(k,k)akk or in theta(k)thetak, depending upon the parameter wheret.

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Wilkinson J H (1965) The Algebraic Eigenvalue Problem Oxford University Press, Oxford

Parameters

Compulsory Input Parameters

1:     wheret – string (length ≥ 1)
Indicates where the elements of θθ are to be found.
wheret = 'I'wheret='I' (In a)
The elements of θθ are in a.
wheret = 'S'wheret='S' (Separate)
The elements of θθ are separate from a, in theta.
Constraint: wheret = 'I'wheret='I' or 'S''S'.
2:     m – int64int32nag_int scalar
mm, the number of rows of the matrix AA.
Constraint: m0m0.
3:     nrowp – int64int32nag_int scalar
, the required number of rows of PP.
If nrowp = 0nrowp=0, an immediate return is effected.
Constraint: 0nrowpn0nrowpn.
4:     a(lda, : :) – complex array
The first dimension of the array a must be at least max (1,m,nrowp)max(1,m,nrowp)
The second dimension of the array must be at least max (1,n)max(1,n)
The leading mm by mm strictly lower triangular part of the array a, and the mm by (nm)(n-m) rectangular part of a with top left-hand corner at element a(1,m + 1)a1m+1 must contain details of the matrix PP. In addition, if wheret = 'I'wheret='I', the diagonal elements of a must contain the elements of θθ.
5:     theta( : :) – complex array
Note: the dimension of the array theta must be at least max (1,m)max(1,m) if wheret = 'S'wheret='S', and at least 11 otherwise.
If wheret = 'S'wheret='S', the array theta must contain the elements of θθ. If theta(k) = 0.0thetak=0.0, PkPk is assumed to be II, if theta(k) = αthetak=α and Re(α) < 0.0Re(α)<0.0, PkPk is assumed to be of the form
Pk =
  I 0 0 0 α 0 0 0 I  
,
Pk= I 0 0 0 α 0 0 0 I ,
otherwise theta(k)thetak is assumed to contain θkθk given by
θk = (ζk,Im(γk)).
θk=(ζk,Im(γk)).
If wheret = 'I'wheret='I', the array theta is not referenced.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the array a.
nn, the number of columns of the matrix AA.
Constraint: nmnm.

Input Parameters Omitted from the MATLAB Interface

lda work

Output Parameters

1:     a(lda, : :) – complex array
The first dimension of the array a will be max (1,m,nrowp)max(1,m,nrowp)
The second dimension of the array will be max (1,n)max(1,n)
ldamax (1,m,nrowp)ldamax(1,m,nrowp).
The first nrowp rows of the array a store the first nrowp rows of the nn by nn unitary matrix PHPH.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=-1
On entry,wheret'I'wheret'I' or 'S''S',
orm < 0m<0,
orn < mn<m,
ornrowp < 0nrowp<0 or nrowp > nnrowp>n,
orlda < max (1,m,nrowp)lda<max(1,m,nrowp).

Accuracy

The computed matrix PP satisfies the relation
P = Q + E,
P=Q+E,
where QQ is an exactly unitary matrix and
Ecε,
Ecε,
where εε the machine precision (see nag_machine_precision (x02aj)), cc is a modest function of nn, and . . denotes the spectral (two) norm. See also Section [Accuracy] in (f01rj).

Further Comments

The approximate number of floating point operations is given by
(8/3)n[(3nm)(2m)m(m)], if ​m, and ​
(8/3)2(3n), if ​ < m.
83n[(3n-m)(2-m)-m(-m)], if ​m, and ​ 832(3n-), if ​<m.

Example

function nag_matop_complex_gen_rq_formq_example
wheret = 'Separate';
m = int64(3);
nrowp = int64(5);
a = [0.7878385971583354,  -0.2549249642552304 - 0.4005963724010764i, ...
     -0.2773500981126146 - 0.2773500981126146i, ...
    -0.2849798528036647 + 0.5586154898871638i,  0.1153902061831629 + 0.7031378339767638i;
      0.0395714585753771 + 0.5221710199103989i, ...
    -2.112235418114766 + 0i,  -1.109400392450458 - 0.5547001962252291i, ...
    0.1283479119207073 + 0.2317354439625548i,  0.07898771606177842 - 0.03608286554775068i;
      -0.2265135394293346 + 0.2265135394293346i, ...
    0.04530270788586691 + 0.3171189552010684i,  -3.605551275463989 + 0i,  0 - 0i,  0 + 0.5436324946304029i;
      0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i;
      0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i];
theta = [ 1.038730559968832 - 0.100646644310659i;
      1.180971629471905 + 0.3808634421302063i;
      1.224430551972102 - 0i];
[aOut, ifail] = ...
    nag_matop_complex_gen_rq_formq(wheret, m, nrowp, a, theta)
 

aOut =

  -0.1970 - 0.1970i   0.0394 - 0.2757i   0.3151 + 0.1576i   0.1970 + 0.5909i  -0.1182 + 0.5646i
   0.1639 + 0.4916i  -0.2950 + 0.4261i   0.4516 + 0.3205i  -0.0473 + 0.3314i   0.0328 - 0.2076i
   0.2774 + 0.2774i  -0.0555 + 0.3883i  -0.4992 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.6656i
   0.3637 - 0.3213i  -0.4752 - 0.0982i  -0.2762 + 0.3049i   0.5121 + 0.0475i  -0.2287 - 0.2072i
   0.0123 - 0.5142i  -0.4187 + 0.2987i  -0.0339 - 0.3867i  -0.3613 + 0.3239i   0.2901 - 0.0254i


ifail =

                    0


function f01rk_example
wheret = 'Separate';
m = int64(3);
nrowp = int64(5);
a = [0.7878385971583354,  -0.2549249642552304 - 0.4005963724010764i, ...
     -0.2773500981126146 - 0.2773500981126146i, ...
    -0.2849798528036647 + 0.5586154898871638i,  ...
     0.1153902061831629 + 0.7031378339767638i;
      0.0395714585753771 + 0.5221710199103989i, ...
    -2.112235418114766 + 0i,  -1.109400392450458 - 0.5547001962252291i, ...
    0.1283479119207073 + 0.2317354439625548i,  ...
    0.07898771606177842 - 0.03608286554775068i;
      -0.2265135394293346 + 0.2265135394293346i, ...
    0.04530270788586691 + 0.3171189552010684i,  -3.605551275463989 + 0i, ...
      0 - 0i,  0 + 0.5436324946304029i;
      0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i;
      0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i,  0 + 0i];
theta = [ 1.038730559968832 - 0.100646644310659i;
      1.180971629471905 + 0.3808634421302063i;
      1.224430551972102 - 0i];
[aOut, ifail] = f01rk(wheret, m, nrowp, a, theta)
 

aOut =

  -0.1970 - 0.1970i   0.0394 - 0.2757i   0.3151 + 0.1576i   0.1970 + 0.5909i  -0.1182 + 0.5646i
   0.1639 + 0.4916i  -0.2950 + 0.4261i   0.4516 + 0.3205i  -0.0473 + 0.3314i   0.0328 - 0.2076i
   0.2774 + 0.2774i  -0.0555 + 0.3883i  -0.4992 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.6656i
   0.3637 - 0.3213i  -0.4752 - 0.0982i  -0.2762 + 0.3049i   0.5121 + 0.0475i  -0.2287 - 0.2072i
   0.0123 - 0.5142i  -0.4187 + 0.2987i  -0.0339 - 0.3867i  -0.3613 + 0.3239i   0.2901 - 0.0254i


ifail =

                    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