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_dorghr (f08nf)

Purpose

nag_lapack_dorghr (f08nf) generates the real orthogonal matrix QQ which was determined by nag_lapack_dgehrd (f08ne) when reducing a real general matrix AA to Hessenberg form.

Syntax

[a, info] = f08nf(ilo, ihi, a, tau, 'n', n)
[a, info] = nag_lapack_dorghr(ilo, ihi, a, tau, 'n', n)

Description

nag_lapack_dorghr (f08nf) is intended to be used following a call to nag_lapack_dgehrd (f08ne), which reduces a real general matrix AA to upper Hessenberg form HH by an orthogonal similarity transformation: A = QHQTA=QHQT. nag_lapack_dgehrd (f08ne) represents the matrix QQ as a product of ihiiloihi-ilo elementary reflectors. Here iloilo and ihiihi are values determined by nag_lapack_dgebal (f08nh) when balancing the matrix; if the matrix has not been balanced, ilo = 1ilo=1 and ihi = nihi=n.
This function may be used to generate QQ explicitly as a square matrix. QQ has the structure:
Q =
  I 0 0 0 Q22 0 0 0 I  
Q = I 0 0 0 Q22 0 0 0 I
where Q22Q22 occupies rows and columns iloilo to ihiihi.

References

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

Parameters

Compulsory Input Parameters

1:     ilo – int64int32nag_int scalar
2:     ihi – int64int32nag_int scalar
These must be the same parameters ilo and ihi, respectively, as supplied to nag_lapack_dgehrd (f08ne).
Constraints:
  • if n > 0n>0, 1 ilo ihi n 1 ilo ihi n ;
  • if n = 0n=0, ilo = 1ilo=1 and ihi = 0ihi=0.
3:     a(lda, : :) – double array
The first dimension of the array a must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,n)max(1,n)
Details of the vectors which define the elementary reflectors, as returned by nag_lapack_dgehrd (f08ne).
4:     tau( : :) – double array
Note: the dimension of the array tau must be at least max (1,n1)max(1,n-1).
Further details of the elementary reflectors, as returned by nag_lapack_dgehrd (f08ne).

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a The second dimension of the array a.
nn, the order of the matrix QQ.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda work lwork

Output Parameters

1:     a(lda, : :) – double array
The first dimension of the array a will be max (1,n)max(1,n)
The second dimension of the array will be max (1,n)max(1,n)
ldamax (1,n)ldamax(1,n).
The nn by nn orthogonal matrix QQ.
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: n, 2: ilo, 3: ihi, 4: a, 5: lda, 6: tau, 7: work, 8: lwork, 9: 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 matrix QQ differs from an exactly orthogonal matrix by a matrix EE such that
E2 = O(ε) ,
E2 = O(ε) ,
where εε is the machine precision.

Further Comments

The total number of floating point operations is approximately (4/3)q343q3, where q = ihiiloq=ihi-ilo.
The complex analogue of this function is nag_lapack_zunghr (f08nt).

Example

function nag_lapack_dorghr_example
ilo = int64(1);
ihi = int64(4);
a = [0.35, -0.1159524296205035, -0.3886010343233214, -0.2941840753473021;
     -0.5140038910358558, 0.1224867524602574, 0.1003597896821503, 0.1125618799705319;
     -0.7284721282927631, 0.6442636185270625, -0.1357001717571131, -0.09768162270493326;
     0.4139046183481608, -0.1665445794905699, 0.4262443722078449, 0.1632134192968561];
tau = [1.175095950769217;
     1.946022972139863;
     0];
[aOut, info] = nag_lapack_dorghr(ilo, ihi, a, tau)
 

aOut =

    1.0000         0         0         0
         0   -0.1751   -0.9675   -0.1827
         0    0.8560   -0.2413    0.4572
         0   -0.4864   -0.0763    0.8704


info =

                    0


function f08nf_example
ilo = int64(1);
ihi = int64(4);
a = [0.35, -0.1159524296205035, -0.3886010343233214, -0.2941840753473021;
     -0.5140038910358558, 0.1224867524602574, 0.1003597896821503, 0.1125618799705319;
     -0.7284721282927631, 0.6442636185270625, -0.1357001717571131, -0.09768162270493326;
     0.4139046183481608, -0.1665445794905699, 0.4262443722078449, 0.1632134192968561];
tau = [1.175095950769217;
     1.946022972139863;
     0];
[aOut, info] = f08nf(ilo, ihi, a, tau)
 

aOut =

    1.0000         0         0         0
         0   -0.1751   -0.9675   -0.1827
         0    0.8560   -0.2413    0.4572
         0   -0.4864   -0.0763    0.8704


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