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_real_gen_rq (f01qj)

Purpose

nag_matop_real_gen_rq (f01qj) finds the RQRQ factorization of the real mm by nn (mnmn) matrix AA, so that AA is reduced to upper triangular form by means of orthogonal transformations from the right.

Syntax

[a, zeta, ifail] = f01qj(a, 'm', m, 'n', n)
[a, zeta, ifail] = nag_matop_real_gen_rq(a, 'm', m, 'n', n)

Description

The mm by nn matrix AA is factorized as
when  m < n, A = RPT when  m = n,
A= R 0 PT when  m<n, A=RPT when  m=n,
(R0)
A = PT
where PP is an nn by nn orthogonal 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 + 1m-k+1)th transformation matrix, PkPk, being used to introduce zeros into the kkth row of AA. PkPk has the form
Pk = IukukT,
Pk=I-ukukT,
where
uk =
  wk ζk 0 zk  
,
uk= wk ζk 0 zk ,
ζkζk is a scalar, wkwk is an (k1)(k-1) element vector and zkzk is an (nm)(n-m) element vector. ukuk is chosen to annihilate the elements in the kkth row of AA.
The vector ukuk is returned in the kkth element of zeta and in the kkth row of a, such that ζkζk is in zeta(k)zetak, the elements of wkwk are in a(k,1),,a(k,k1)ak1,,akk-1 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.

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, : :) – double 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 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, : :) – double 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 mm strictly lower triangular part of a and the mm by (nm)(n-m) rectangular part of a to the right of the upper triangular part will contain details of the factorization as described in Section [Description].
2:     zeta(m) – double array
zeta(k)zetak contains the scalar ζkζk for the (mk + 1)(m-k+1)th transformation. If Pk = IPk=I then zeta(k) = 0.0zetak=0.0, otherwise zeta(k)zetak contains ζkζk as described in Section [Description] and ζkζ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)
PT = A + E,
R 0 PT=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 2 × m2(3nm) / 32×m2(3n-m)/3.
The first kk rows of the orthogonal matrix PTPT can be obtained by calling nag_matop_real_gen_rq_formq (f01qk), which overwrites the kk rows of PTPT on the first kk rows of the array a. PTPT is obtained by the call:
[a, ifail] = f01qk('Separate', m, k, a, zeta);

Example

function nag_matop_real_gen_rq_example
a = [2, 2, 1.6, 2, 1.2;
     2.5, 2.5, -0.4, -0.5, -0.3;
     2.5, 2.5, 2.8, 0.5, -2.9];
[aOut, zeta, ifail] = nag_matop_real_gen_rq(a)
 

aOut =

   -3.1446   -1.0705   -2.2283    0.6333    0.7619
    0.5277   -2.8345   -2.2283   -0.1662    0.0945
    0.3766    0.3766   -5.3852    0.0753   -0.4368


zeta =

    1.0092
    1.2981
    1.2329


ifail =

                    0


function f01qj_example
a = [2, 2, 1.6, 2, 1.2;
     2.5, 2.5, -0.4, -0.5, -0.3;
     2.5, 2.5, 2.8, 0.5, -2.9];
[aOut, zeta, ifail] = f01qj(a)
 

aOut =

   -3.1446   -1.0705   -2.2283    0.6333    0.7619
    0.5277   -2.8345   -2.2283   -0.1662    0.0945
    0.3766    0.3766   -5.3852    0.0753   -0.4368


zeta =

    1.0092
    1.2981
    1.2329


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