NAG Library Routine Document
F04ZCF
1 Purpose
F04ZCF estimates the -norm of a complex matrix without accessing the matrix explicitly. It uses reverse communication for evaluating matrix-vector products. The routine may be used for estimating matrix condition numbers.
2 Specification
INTEGER |
ICASE, N, IFAIL |
REAL (KIND=nag_wp) |
ESTNRM |
COMPLEX (KIND=nag_wp) |
X(N), WORK(N) |
|
3 Description
F04ZCF computes an estimate (a lower bound) for the
-norm
of an
by
complex matrix
. The routine regards the matrix
as being defined by a user-supplied ‘Black Box’ which, given an input vector
, can return either of the matrix-vector products
or
, where
is the complex conjugate transpose. A reverse communication interface is used; thus control is returned to the calling program whenever a matrix-vector product is required.
Note: this routine is
not
recommended for use when the elements of
are known explicitly; it is then more efficient to compute the
-norm directly from the formula
(1) above.
The main
use of the routine is for estimating , and hence the condition number
, without forming explicitly ( above).
If, for example, an factorization of is available, the matrix-vector products and required by F04ZCF may be computed by back- and forward-substitutions, without computing .
The routine can also be used to estimate
-norms of matrix products such as
and
, without forming the products explicitly. Further applications are described in
Higham (1988).
Since , F04ZCF can be used to estimate the -norm of by working with instead of .
The algorithm used is based on a method given in
Hager (1984) and is described in
Higham (1988). A comparison of several techniques for condition number estimation is given in
Higham (1987).
Note: F04ZDF can also be used to estimate the norm of a real matrix.
F04ZDF uses a more recent algorithm than F04ZCF and it is recommended that
F04ZDF be used in place of F04ZCF.
4 References
Hager W W (1984) Condition estimates SIAM J. Sci. Statist. Comput. 5 311–316
Higham N J (1987) A survey of condition number estimation for triangular matrices SIAM Rev. 29 575–596
Higham N J (1988) FORTRAN codes for estimating the one-norm of a real or complex matrix, with applications to condition estimation ACM Trans. Math. Software 14 381–396
5 Parameters
Note: this routine uses
reverse communication. Its use involves an initial entry, intermediate exits and re-entries, and a final exit, as indicated by the
parameter ICASE. Between intermediate exits and re-entries,
all parameters other than X must remain unchanged.
- 1: – INTEGERInput/Output
-
On initial entry: must be set to .
On intermediate exit:
or
, and
, for
, contain the elements of a vector
. The calling program must
(a) |
evaluate (if ) or (if ), where is the complex conjugate transpose; |
(b) |
place the result in X; and, |
(c) |
call F04ZCF once again, with all the other parameters unchanged. |
On final exit: .
- 2: – INTEGERInput
-
On initial entry: , the order of the matrix .
Constraint:
.
- 3: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
On initial entry: need not be set.
On intermediate exit:
contains the current vector .
On intermediate re-entry: must contain (if ) or (if ).
On final exit: the array is undefined.
- 4: – REAL (KIND=nag_wp)Input/Output
-
On initial entry: need not be set.
On intermediate exit:
should not be changed.
On final exit: an estimate (a lower bound) for .
- 5: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
On initial entry: need not be set.
On final exit: contains a vector
such that
where
(
is not returned). If
and
ESTNRM is large, then
is an approximate null vector for
.
- 6: – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction 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 parameter, 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:
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.8 in the Essential Introduction for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.7 in the Essential Introduction for further information.
Dynamic memory allocation failed.
See
Section 3.6 in the Essential Introduction for further information.
7 Accuracy
In extensive tests on
random matrices of size up to
the estimate
ESTNRM has been found always to be within a factor eleven of
; often the estimate has many correct figures. However, matrices exist for which the estimate is smaller than
by an arbitrary factor; such matrices are very unlikely to arise in practice. See
Higham (1988) for further details.
8 Parallelism and Performance
F04ZCF is not threaded by NAG in any implementation.
F04ZCF 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 time taken by F04ZCF is proportional to . For most problems the time taken during calls to F04ZCF will be negligible compared with the time spent evaluating matrix-vector products between calls to F04ZCF.
The number of matrix-vector products required varies from to (or is if ). In most cases products are required; it is rare for more than to be needed.
It is your responsibility to guard against potential overflows during evaluation of the matrix-vector products. In particular, when estimating using a triangular factorization of , F04ZCF should not be called if one of the factors is exactly singular – otherwise division by zero may occur in the substitutions.
To estimate the
-norm of the inverse of a matrix
, the following skeleton code can normally be used:
... code to factorize A ...
IF (A is not singular) THEN
ICASE = 0
10 CALL F04ZCF (ICASE,N,X,ESTNRM,WORK,IFAIL)
IF (ICASE.NE.0) THEN
IF (ICASE.EQ.1) THEN
... code to compute A(-1)x ...
ELSE
... code to compute (A(-1)(H)) x ...
END IF
GO TO 10
END IF
END IF
To compute or , solve the equation or for , overwriting on . The code will vary, depending on the type of the matrix , and the NAG routine used to factorize .
Note that if
is any type of
Hermitian matrix, then
, and the
code following the call of F04ZCF
can be reduced to:
IF (ICASE.NE.0) THEN
... code to compute A(-1)x ...
GO TO 10
END IF
The example program in
Section 10 illustrates how F04ZCF can be used in conjunction with NAG Library routines for complex band matrices (factorized by
F07BRF (ZGBTRF)).
It is also straightforward to use F04ZCF for Hermitian positive definite matrices, using
F06TFF,
F07FRF (ZPOTRF) and
F07FSF (ZPOTRS) for factorization and solution.
For upper or lower triangular matrices, no factorization routine is needed:
and
may be computed by calls to
F06SJF (ZTRSV) (or
F06SKF (ZTBSV) if the matrix is banded, or
F06SLF (ZTPSV) if the matrix is stored in packed form).
10 Example
This example estimates the condition number
of the order
matrix
where
is a band matrix stored in the packed format required by
F07BRF (ZGBTRF) and
F07BSF (ZGBTRS).
Further examples of the technique for condition number estimation in the case of real matrices can be seen in the example program section of
F04YCF.
10.1 Program Text
Program Text (f04zcfe.f90)
10.2 Program Data
Program Data (f04zcfe.d)
10.3 Program Results
Program Results (f04zcfe.r)