NAG Library Routine Document
f08ktf
(zungbr)
1
Purpose
f08ktf (zungbr) generates one of the complex unitary matrices
or
which were determined by
f08ksf (zgebrd) when reducing a complex matrix to bidiagonal form.
2
Specification
Fortran Interface
Integer, Intent (In) | :: |
m,
n,
k,
lda,
lwork | Integer, Intent (Out) | :: |
info | Complex (Kind=nag_wp), Intent (In) | :: |
tau(*) | Complex (Kind=nag_wp), Intent (Inout) | :: |
a(lda,*) | Complex (Kind=nag_wp), Intent (Out) | :: |
work(max(1,lwork)) | Character (1), Intent (In) | :: |
vect |
|
C Header Interface
#include nagmk26.h
void |
f08ktf_ (
const char *vect,
const Integer *m,
const Integer *n,
const Integer *k,
Complex a[],
const Integer *lda,
const Complex tau[],
Complex work[],
const Integer *lwork,
Integer *info,
const Charlen length_vect) |
|
The routine may be called by its
LAPACK
name zungbr.
3
Description
f08ktf (zungbr) is intended to be used after a call to
f08ksf (zgebrd), which reduces a complex rectangular matrix
to real bidiagonal form
by a unitary transformation:
.
f08ksf (zgebrd) represents the matrices
and
as products of elementary reflectors.
This routine may be used to generate or explicitly as square matrices, or in some cases just the leading columns of or the leading rows of .
The various possibilities are specified by the arguments
vect,
m,
n and
k. The appropriate values to cover the most likely cases are as follows (assuming that
was an
by
matrix):
1. |
To form the full by matrix :
Call ZUNGBR('Q',m,m,n,...)
(note that the array a must have at least columns).
|
2. |
If , to form the leading columns of :
Call ZUNGBR('Q',m,n,n,...)
|
3. |
To form the full by matrix :
Call ZUNGBR('P',n,n,m,...)
(note that the array a must have at least rows).
|
4. |
If , to form the leading rows of :
Call ZUNGBR('P',m,n,m,...)
|
4
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
5
Arguments
- 1: – Character(1)Input
-
On entry: indicates whether the unitary matrix
or
is generated.
- is generated.
- is generated.
Constraint:
or .
- 2: – IntegerInput
-
On entry: , the number of rows of the unitary matrix or to be returned.
Constraint:
.
- 3: – IntegerInput
-
On entry: , the number of columns of the unitary matrix or to be returned.
Constraints:
- ;
- if and , ;
- if and , ;
- if and , ;
- if and , .
- 4: – IntegerInput
-
On entry: if
, the number of columns in the original matrix
.
If , the number of rows in the original matrix .
Constraint:
.
- 5: – Complex (Kind=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
a
must be at least
.
On entry: details of the vectors which define the elementary reflectors, as returned by
f08ksf (zgebrd).
On exit: the unitary matrix
or
, or the leading rows or columns thereof, as specified by
vect,
m and
n.
- 6: – IntegerInput
-
On entry: the first dimension of the array
a as declared in the (sub)program from which
f08ktf (zungbr) is called.
Constraint:
.
- 7: – Complex (Kind=nag_wp) arrayInput
-
Note: the dimension of the array
tau
must be at least
if
and at least
if
.
On entry: further details of the elementary reflectors, as returned by
f08ksf (zgebrd) in its argument
tauq if
, or in its argument
taup if
.
- 8: – Complex (Kind=nag_wp) arrayWorkspace
-
On exit: if
, the real part of
contains the minimum value of
lwork required for optimal performance.
- 9: – IntegerInput
-
On entry: the dimension of the array
work as declared in the (sub)program from which
f08ktf (zungbr) is called.
If
, a workspace query is assumed; the routine only calculates the optimal size of the
work array, returns this value as the first entry of the
work array, and no error message related to
lwork is issued.
Suggested value:
for optimal performance, , where is the optimal block size.
Constraint:
or .
- 10: – IntegerOutput
On exit:
unless the routine detects an error (see
Section 6).
6
Error Indicators and Warnings
-
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
7
Accuracy
The computed matrix
differs from an exactly unitary matrix by a matrix
such that
where
is the
machine precision. A similar statement holds for the computed matrix
.
8
Parallelism and Performance
f08ktf (zungbr) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f08ktf (zungbr) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The total number of real floating-point operations for the cases listed in
Section 3 are approximately as follows:
1. |
To form the whole of :
- if ,
- if ;
|
2. |
To form the leading columns of when :
|
3. |
To form the whole of :
- if ,
- if ;
|
4. |
To form the leading rows of when :
|
The real analogue of this routine is
f08kff (dorgbr).
10
Example
For this routine two examples are presented, both of which involve computing the singular value decomposition of a matrix
, where
in the first example and
in the second.
must first be reduced to tridiagonal form by
f08ksf (zgebrd). The program then calls
f08ktf (zungbr) twice to form
and
, and passes these matrices to
f08msf (zbdsqr), which computes the singular value decomposition of
.
10.1
Program Text
Program Text (f08ktfe.f90)
10.2
Program Data
Program Data (f08ktfe.d)
10.3
Program Results
Program Results (f08ktfe.r)