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)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_matop_complex_trapez_rq (f01rg) reduces the complex m by n (mn) upper trapezoidal matrix A 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 m by nmn upper trapezoidal matrix A given by
A= U X ,  
where U is an m by m upper triangular matrix, is factorized as
A= R 0 PH,  
where P is an n by n unitary matrix and R is an m by m upper triangular matrix.
P is given as a sequence of Householder transformation matrices
P=PmP2P1,  
the m-k+1th transformation matrix, Pk, being used to introduce zeros into the kth row of A. Pk has the form
Pk= I 0 0 Tk ,  
where
Tk=I-γkukukH, uk= ζk 0 zk cr ,  
γk is a scalar for which Reγk=1.0, ζk is a real scalar and zk is an n-m element vector. γk, ζk and zk are chosen to annihilate the elements of the kth row of X and to make the diagonal elements of R real.
The scalar γk and the vector uk are returned in the kth element of the array theta and in the kth row of a, such that θk, given by
θk=ζk,Imγk,  
is in thetak and the elements of zk are in akm+1,,akn. The elements of R 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:     alda: – complex array
The first dimension of the array a must be at least max1,m.
The second dimension of the array a must be at least max1,n.
The leading m by n 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.
m, the number of rows of the matrix A.
When m=0 then an immediate return is effected.
Constraint: m0.
2:     n int64int32nag_int scalar
Default: the second dimension of the array a.
n, the number of columns of the matrix A.
Constraint: nm.

Output Parameters

1:     alda: – complex array
The first dimension of the array a will be max1,m.
The second dimension of the array a will be max1,n.
The m by m upper triangular part of a will contain the upper triangular matrix R, and the m by n-m upper trapezoidal part of a will contain details of the factorization as described in Description.
2:     thetam – complex array
thetak contains the scalar θk for the m-k+1th transformation. If Tk=I then thetak=0.0; if
Tk= α 0 0 I ,  Reα<0.0  
then thetak=α, otherwise thetak contains θk as described in Description and Reθk is always in the range 1.0,2.0.
3:     ifail int64int32nag_int scalar
ifail=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

Errors or warnings detected by the function:
   ifail=-1
On entry,m<0,
orn<m,
orlda<m.
   ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
   ifail=-399
Your licence key may have expired or may not have been installed correctly.
   ifail=-999
Dynamic memory allocation failed.

Accuracy

The computed factors R and P satisfy the relation
R 0 PH=A+E,  
where
Ecε A,  
ε is the machine precision (see nag_machine_precision (x02aj)), c is a modest function of m and n, and . denotes the spectral (two) norm.

Further Comments

The approximate number of floating-point operations is given by 8×m2n-m.

Example

This example reduces the 3 by 4 matrix
2.4 0.8+0.8i -1.4+0.6i 3.0-1.0i 0.0 1.6i+0.0 0.8+0.3i 0.4+0.5i 0.0 0.0i+0.0 1.0i+0.0 2.0-1.0i  
to upper triangular form.
function f01rg_example


fprintf('f01rg example results\n\n');

a = [ 2.4,     0.8 + 0.8i, -1.4 + 0.6i,  3   - i;
      0 + 0i,  1.6 + 0i,    0.8 + 0.3i,  0.4 + 0.5i;
      0 + 0i,  0   + 0i,    1   + 0i,    2   - i];

[RQ, theta, ifail] = f01rg(a);

disp('RQ Factorization of A');
disp('Vector theta');
disp(theta');
disp('Matrix A after factorization (R in left-hand upper triangle');
disp(RQ);


f01rg example results

RQ Factorization of A
Vector theta
   1.2924 + 0.0000i   1.3861 + 0.0000i   1.1867 + 0.0000i

Matrix A after factorization (R in left-hand upper triangle
  -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


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–2015