nag_complex_form_q (f01rec) (PDF version)
f01 Chapter Contents
f01 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_complex_form_q (f01rec)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_complex_form_q (f01rec) returns the first ncolq  columns of the m  by m  unitary matrix Q , where Q  is given as the product of Householder transformation matrices.
This function is intended for use following nag_complex_qr (f01rcc).

2  Specification

#include <nag.h>
#include <nagf01.h>
void  nag_complex_form_q (Nag_WhereElements wheret, Integer m, Integer n, Integer ncolq, Complex a[], Integer tda, const Complex theta[], NagError *fail)

3  Description

The unitary matrix Q  is assumed to be given by
Q = Q n Q n-1 Q 1 H ,
Q k  being given in the form
Q k = I 0 0 T k ,
where
T k = I - γ k u k u k H ,
u k = ζ k z k ,
γ k  is a scalar for which Reγ k = 1.0 , ζ k  is a real scalar and z k  is an m-k  element vector.
z k  must be supplied in the k-1 th column of a in elements a[k×tda+k-1] , , a[m-1×tda+k-1]  and θ k , given by
θ k = ζ k ,Im γ k ,
must be supplied either in a[k-1×tda+k-1]  or in theta[k-1]  depending upon the argument wheret.

4  References

Wilkinson J H (1965) The Algebraic Eigenvalue Problem Oxford University Press, Oxford

5  Arguments

1:     wheretNag_WhereElementsInput
On entry: the elements of θ  are to be found as follows:
  • wheret=Nag_ElementsIn, the elements of θ  are in A .
  • wheret=Nag_ElementsSeparate, the elements of θ  are separate from A , in theta.
Constraint: wheret must be one of Nag_ElementsIn or Nag_ElementsSeparate.
2:     mIntegerInput
On entry: m , the number of rows of A .
Constraint: mn .
3:     nIntegerInput
On entry: n , the number of columns of A .
Constraint: n0 .
4:     ncolqIntegerInput
On entry: ncolq , the required number of columns of Q .
When ncolq=0  then an immediate return is effected.
Constraint: 0 ncolq m .
5:     a[m×tda]ComplexInput/Output
On entry: the leading m  by n  strictly lower triangular part of the array a must contain details of the matrix Q . In addition, when wheret=Nag_ElementsIn, then the diagonal elements of a must contain the elements of θ  as described under the argument theta.
On exit: the first ncolq columns of the array a are overwritten by the first ncolq columns of the m  by m  unitary matrix Q . When n=0  then the first ncolq columns of a are overwritten by the first ncolq columns of the unit matrix.
6:     tdaIntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint: tda maxn,ncolq .
7:     theta[n]const ComplexInput
On entry: if wheret=Nag_ElementsSeparate, the array theta must contain the elements of θ . If theta[k-1] = 0.0  then T k  is assumed to be I ; if theta[k-1] = α , with Reα < 0.0 , then T k  is assumed to be of the form
T k = α 0 0 I ; ​
otherwise theta[k-1]  is assumed to contain θ k  given by θ k = ζ k ,Im γ k .
When wheret=Nag_ElementsIn, the array theta is not referenced and may be set to the null pointer, i.e., (Complex *)0.
8:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_2_INT_ARG_GT
On entry, ncolq=value  while m=value . These arguments must satisfy ncolqm .
NE_2_INT_ARG_LT
On entry, m=value  while n=value . These arguments must satisfy mn .
On entry, tda=value  while maxn,ncolq = ncolq . These arguments must satisfy tdan .
NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument wheret had an illegal value.
NE_INT_ARG_LT
On entry, n=value.
Constraint: n0.
On entry, ncolq=value.
Constraint: ncolq0.

7  Accuracy

The computed matrix Q  satisfies the relation
Q = P + E ,
where P  is an exactly unitary matrix and
E c ε ,
ε  being the machine precision, c  is a modest function of m  and .  denotes the spectral (two) norm. See also Section 8 of nag_complex_qr (f01rcc).

8  Further Comments

The approximate number of real floating point operations required is given by
8 3 n 3 m - n 2 ncolq - n - n ncolq - n ncolq > n 8 3 ncolq 2 3 m - ncolq ncolq n .

9  Example

To obtain the 5 by 5 unitary matrix Q  following the QR  factorization of the 5 by 3 matrix A  given by
A = 0.5 i -0.5 + 1.5 i -1.0 + 1.4 i 0.4 + 0.3 i 0.9 + 1.3 i 0.2 + 1.4 i 0.4 +0.3 i -0.4 + 0.4 i - 1.8 +1.4 i 0.3 - 0.4 i 0.1 + 0.7 i - 0.0 +1.4 i -0.3 i 0.3 + 0.3 i 2.4 i .

9.1  Program Text

Program Text (f01rece.c)

9.2  Program Data

Program Data (f01rece.d)

9.3  Program Results

Program Results (f01rece.r)


nag_complex_form_q (f01rec) (PDF version)
f01 Chapter Contents
f01 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012