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_trapez_rq (f01rg)

Purpose

nag_matop_complex_trapez_rq (f01rg) reduces the complex mm by nn (mnmn) upper trapezoidal matrix AA to upper triangular form by means of unitary transformations.

Syntax

[a, theta, ifail] = f01rg(a, 'm', m, 'n', n)
[a, theta, ifail] = nag_matop_complex_trapez_rq(a, 'm', m, 'n', n)

Description

The mm by n(mn)n(mn) upper trapezoidal matrix AA given by
A =
(UX)
,
A= U X ,
where UU is an mm by mm upper triangular matrix, is factorized as
A =
(R0)
PH,
A= R 0 PH,
where PP is an nn by nn unitary matrix and RR is an mm by mm upper triangular matrix.
PP is given as a sequence of Householder transformation matrices
P = PmP2P1,
P=PmP2P1,
the (mk + 1)(m-k+1)th transformation matrix, PkPk, being used to introduce zeros into the kkth row of AA. PkPk has the form
Pk =
(I0)
0 Tk
,
Pk= I 0 0 Tk ,
where
Tk=I-γkukukH, uk= ζk 0 zk cr ,
Tk = I − γkukukH,
uk = ( ζk 0 zk cr ),
γkγk is a scalar for which Re(γk) = 1.0Re(γk)=1.0, ζkζk is a real scalar and zkzk is an (nm)(n-m) element vector. γkγk, ζkζk and zkzk are chosen to annihilate the elements of the kkth row of XX and to make the diagonal elements of RR real.
The scalar γkγk and the vector ukuk are returned in the kkth element of the array theta and in the kkth row of a, such that θkθk, given by
θk = (ζk,Im(γk)),
θk=(ζk,Im(γk)),
is in theta(k)thetak and the elements of zkzk are in a(k,m + 1),,a(k,n)akm+1,,akn. The elements of RR are returned in the upper triangular part of a.
For further information on this factorization and its use see Section 6.5 of Golub and Van Loan (1996).

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:     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)
The leading mm by nn upper trapezoidal part of the array a must contain the matrix to be factorized.

Optional Input Parameters

1:     m – int64int32nag_int scalar
Default: The first dimension of the array a.
mm, the number of rows of the matrix AA.
When m = 0m=0 then an immediate return is effected.
Constraint: m0m0.
2:     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

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 mm upper triangular part of a will contain the upper triangular matrix RR, and the mm by (nm)(n-m) upper trapezoidal part of a will contain details of the factorization as described in Section [Description].
2:     theta(m) – complex array
theta(k)thetak contains the scalar θkθk for the (mk + 1)(m-k+1)th transformation. If Tk = ITk=I then theta(k) = 0.0thetak=0.0; if
Tk =
(α0)
0 I
,  Re(α) < 0.0
Tk= α 0 0 I ,  Re(α)<0.0
then theta(k) = αthetak=α, otherwise theta(k)thetak contains θkθk as described in Section [Description] and Re(θk)Re(θk) is always in the range (1.0,sqrt(2.0))(1.0,2.0).
3:     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,m < 0m<0,
orn < mn<m,
orlda < mlda<m.

Accuracy

The computed factors RR and PP satisfy the relation
(R0)
PH = A + E,
R 0 PH=A+E,
where
Ecε A,
Ecε A,
εε is the machine precision (see nag_machine_precision (x02aj)), cc is a modest function of mm and nn, and . . denotes the spectral (two) norm.

Further Comments

The approximate number of floating point operations is given by 8 × m2(nm)8×m2(n-m).

Example

function nag_matop_complex_trapez_rq_example
a = [2.4,  0.8 + 0.8i,  -1.4 + 0.6i,  3 - 1i;
      0 + 0i,  1.6 + 0i,  0.8 + 0.3i,  0.4 + 0.5i;
      0 + 0i,  0 + 0i,  1 + 0i,  2 - 1i];
[aOut, theta, ifail] = nag_matop_complex_trapez_rq(a)
 

aOut =

  -3.5808 + 0.0000i   0.2533 - 0.9059i  -2.2862 - 0.6532i   0.5120 + 0.2601i
   0.0000 + 0.0000i  -1.7369 + 0.0000i  -0.4491 - 0.6940i  -0.2544 - 0.1187i
   0.0000 + 0.0000i   0.0000 + 0.0000i  -2.4495 + 0.0000i   0.6880 + 0.3440i


theta =

   1.2924 + 0.0000i
   1.3861 + 0.0000i
   1.1867 + 0.0000i


ifail =

                    0


function f01rg_example
a = [2.4,  0.8 + 0.8i,  -1.4 + 0.6i,  3 - 1i;
      0 + 0i,  1.6 + 0i,  0.8 + 0.3i,  0.4 + 0.5i;
      0 + 0i,  0 + 0i,  1 + 0i,  2 - 1i];
[aOut, theta, ifail] = f01rg(a)
 

aOut =

  -3.5808 + 0.0000i   0.2533 - 0.9059i  -2.2862 - 0.6532i   0.5120 + 0.2601i
   0.0000 + 0.0000i  -1.7369 + 0.0000i  -0.4491 - 0.6940i  -0.2544 - 0.1187i
   0.0000 + 0.0000i   0.0000 + 0.0000i  -2.4495 + 0.0000i   0.6880 + 0.3440i


theta =

   1.2924 + 0.0000i
   1.3861 + 0.0000i
   1.1867 + 0.0000i


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