NAG Library Routine Document
f01rjf (complex_gen_rq)
1
Purpose
f01rjf finds the factorization of the complex by (), matrix , so that is reduced to upper triangular form by means of unitary transformations from the right.
2
Specification
Fortran Interface
Integer, Intent (In) | :: | m, n, lda | Integer, Intent (Inout) | :: | ifail | Complex (Kind=nag_wp), Intent (Inout) | :: | a(lda,*) | Complex (Kind=nag_wp), Intent (Out) | :: | theta(m) |
|
C Header Interface
#include <nagmk26.h>
void |
f01rjf_ (const Integer *m, const Integer *n, Complex a[], const Integer *lda, Complex theta[], Integer *ifail) |
|
3
Description
The
by
matrix
is factorized as
where
is an
by
unitary matrix and
is an
by
upper triangular matrix.
is given as a sequence of Householder transformation matrices
the
th transformation matrix,
, being used to introduce zeros into the
th row of
.
has the form
where
is a scalar for which
,
is a real scalar,
is a
element vector and
is an
element vector.
and
are chosen to annihilate the elements in the
th row of
.
The scalar
and the vector
are returned in the
th element of
theta and in the
th row of
a, such that
, given by
is in
, the elements of
are in
and the elements of
are in
. The elements of
are returned in the upper triangular part of
a.
4
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
5
Arguments
- 1: – IntegerInput
-
On entry:
, the number of rows of the matrix
.
When then an immediate return is effected.
Constraint:
.
- 2: – IntegerInput
-
On entry: , the number of columns of the matrix .
Constraint:
.
- 3: – Complex (Kind=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
a
must be at least
.
On entry: the leading
by
part of the array
a must contain the matrix to be factorized.
On exit: the
by
upper triangular part of
a will contain the upper triangular matrix
, and the
by
strictly lower triangular part of
a and the
by
rectangular part of
a to the right of the upper triangular part will contain details of the factorization as described in
Section 3.
- 4: – IntegerInput
-
On entry: the first dimension of the array
a as declared in the (sub)program from which
f01rjf is called.
Constraint:
.
- 5: – Complex (Kind=nag_wp) arrayOutput
-
On exit:
contains the scalar
for the
th transformation. If
then
; if
then
, otherwise
contains
as described in
Section 3 and
is always in the range
.
- 6: – IntegerInput/Output
-
On entry:
ifail must be set to
,
. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
.
When the value is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
On entry, and .
Constraint: .
On entry, .
Constraint: .
On entry, and .
Constraint: .
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See
Section 3.7 in How to Use the NAG Library and its Documentation for further information.
7
Accuracy
The computed factors
and
satisfy the relation
where
is the
machine precision (see
x02ajf),
is a modest function of
and
, and
denotes the spectral (two) norm.
8
Parallelism and Performance
f01rjf 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 approximate number of floating-point operations is given by .
The first
rows of the unitary matrix
can be obtained by calling
f01rkf, which overwrites the
rows of
on the first
rows of the array
a.
is obtained by the call:
ifail = 0
Call f01rkf('Separate',m,n,k,a,lda,theta,work,ifail)
must be a
element array. If
is larger than
, then
a must have been declared to have at least
rows.
Operations involving the matrix
can readily be performed by the Level 2 BLAS routines
f06sff (ztrmv) and
f06sjf (ztrsv), (see
Chapter F06), but note that no test for near singularity of
is incorporated into
f06sff (ztrmv). If
is singular, or nearly singular then
f02xuf can be used to determine the singular value decomposition of
.
10
Example
This example obtains the
factorization of the
by
matrix
10.1
Program Text
Program Text (f01rjfe.f90)
10.2
Program Data
Program Data (f01rjfe.d)
10.3
Program Results
Program Results (f01rjfe.r)