PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_linsys_complex_gen_norm_rcomm (f04zd)
Purpose
nag_linsys_complex_gen_norm_rcomm (f04zd) estimates the -norm of a complex rectangular matrix without accessing the matrix explicitly. It uses reverse communication for evaluating matrix products. The function may be used for estimating condition numbers of square matrices.
Syntax
[
irevcm,
x,
y,
estnrm,
work,
rwork,
iwork,
ifail] = f04zd(
irevcm,
x,
y,
estnrm,
seed,
work,
rwork,
iwork, 'm',
m, 'n',
n, 't',
t)
[
irevcm,
x,
y,
estnrm,
work,
rwork,
iwork,
ifail] = nag_linsys_complex_gen_norm_rcomm(
irevcm,
x,
y,
estnrm,
seed,
work,
rwork,
iwork, 'm',
m, 'n',
n, 't',
t)
Description
nag_linsys_complex_gen_norm_rcomm (f04zd) computes an estimate (a lower bound) for the
-norm
of an
by
complex matrix
. The function regards the matrix
as being defined by a user-supplied ‘Black Box’ which, given an
matrix
(with
) or an
matrix
, can return
or
, where
is the complex conjugate transpose. A reverse communication interface is used; thus control is returned to the calling program whenever a matrix product is required.
Note: this function 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 function is for estimating for a square matrix , and hence the condition number
, without forming explicitly ( above).
If, for example, an factorization of is available, the matrix products and required by nag_linsys_complex_gen_norm_rcomm (f04zd) may be computed by back- and forward-substitutions, without computing .
The function 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 , nag_linsys_complex_gen_norm_rcomm (f04zd) can be used to estimate the -norm of by working with instead of .
The algorithm used is described in
Higham and Tisseur (2000).
References
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
Higham N J and Tisseur F (2000) A block algorithm for matrix -norm estimation, with an application to -norm pseudospectra SIAM J. Matrix. Anal. Appl. 21 1185–1201
Parameters
Note: this function uses
reverse communication. Its use involves an initial entry, intermediate exits and re-entries, and a final exit, as indicated by the argument
irevcm. Between intermediate exits and re-entries,
all arguments other than x and y must remain unchanged.
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
On initial entry: must be set to .
On intermediate re-entry:
irevcm must be unchanged.
- 2:
– complex array
-
The first dimension of the array
x must be at least
.
The second dimension of the array
x must be at least
.
On initial entry: need not be set.
On intermediate re-entry: if , must contain .
- 3:
– complex array
-
The first dimension of the array
y must be at least
.
The second dimension of the array
y must be at least
.
On initial entry: need not be set.
On intermediate re-entry: if , must contain .
- 4:
– double scalar
-
On initial entry: need not be set.
On intermediate re-entry: must not be changed.
- 5:
– int64int32nag_int scalar
-
The seed used for random number generation.
If
,
seed is not used.
Constraint:
if , .
- 6:
– complex array
- 7:
– double array
- 8:
– int64int32nag_int array
-
On initial entry: need not be set.
On intermediate re-entry: must not be changed.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the arrays
y,
work. (An error is raised if these dimensions are not equal.)
The number of rows of the matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
x.
On initial entry: , the number of columns of the matrix .
Constraint:
.
- 3:
– int64int32nag_int scalar
Suggested value:
.
Default:
the second dimension of the arrays
x,
y. (An error is raised if these dimensions are not equal.)
The number of columns
of the matrices
and
. This is a argument that can be used to control the accuracy and reliability of the estimate and corresponds roughly to the number of columns of
that are visited during each iteration of the algorithm.
If then a partly random starting matrix is used in the algorithm.
Constraint:
.
Output Parameters
- 1:
– int64int32nag_int scalar
-
On intermediate exit:
or
, and
x contains the
matrix
and
y contains the
matrix
. The calling program must
(a) |
if , evaluate and store the result in y
or
if , evaluate and store the result in x, where is the complex conjugate transpose; |
(b) |
call nag_linsys_complex_gen_norm_rcomm (f04zd) once again, with all the arguments unchanged. |
On final exit: .
- 2:
– complex array
-
The first dimension of the array
x will be
.
The second dimension of the array
x will be
.
On intermediate exit:
if , contains the current matrix .
On final exit: the array is undefined.
- 3:
– complex array
-
The first dimension of the array
y will be
.
The second dimension of the array
y will be
.
On intermediate exit:
if , contains the current matrix .
On final exit: the array is undefined.
- 4:
– double scalar
-
On final exit: an estimate (a lower bound) for .
- 5:
– complex array
- 6:
– double array
- 7:
– int64int32nag_int array
-
- 8:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
Internal error; please contact
NAG.
-
-
Constraint: , or .
On initial entry, .
Constraint: .
-
-
Constraint: .
-
-
Constraint: .
-
-
Constraint: .
-
-
Constraint: .
-
-
Constraint: .
-
-
Constraint: if , .
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
In extensive tests on
random matrices of size up to
the estimate
estnrm has been found always to be within a factor two 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 and Tisseur (2000) for further details.
Further Comments
Timing
For most problems the time taken during calls to nag_linsys_complex_gen_norm_rcomm (f04zd) will be negligible compared with the time spent evaluating matrix products between calls to nag_linsys_complex_gen_norm_rcomm (f04zd).
The number of matrix products required depends on the matrix . At most six products of the form and five products of the form will be required. The number of iterations is independent of the choice of .
Overflow
It is your responsibility to guard against potential overflows during evaluation of the matrix products. In particular, when estimating using a triangular factorization of , nag_linsys_complex_gen_norm_rcomm (f04zd) should not be called if one of the factors is exactly singular – otherwise division by zero may occur in the substitutions.
Choice of t
The argument controls the accuracy and reliability of the estimate. For , the algorithm behaves similarly to the LAPACK estimator xLACON. Increasing typically improves the estimate, without increasing the number of iterations required.
For
, random matrices are used in the algorithm, so for repeatable results the same value of
seed should be used each time.
A value of is recommended for new users.
Use in Conjunction with NAG Library Routines
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)
icase = 0
[icase, x, estnrm, work, ifail] = f04zd(icase, x, estnrm, work);
while (icase ~= 0)
if (icase == 1)
... code to compute A(-1)x ...
else
... code to compute (A(-1)(H)) x ...
end
[icase, x, estnrm, work, ifail] = f04zd(icase, x, estnrm, work);
end
end
To compute
or
, solve the equation
or
storing the result in
y or
x respectively. The code will vary, depending on the type of the matrix
, and the NAG function used to factorize
.
The example program in
Example illustrates how
nag_linsys_complex_gen_norm_rcomm (f04zd) can be used in conjunction with NAG Toolbox function for
factorization of complex matrices
nag_lapack_zgetrf (f07ar)).
It is also straightforward to use
nag_linsys_complex_gen_norm_rcomm (f04zd) for Hermitian positive definite matrices, using
nag_lapack_zpotrf (f07fr) and
nag_lapack_zpotrs (f07fs) for factorization and solution.
Example
This example estimates the condition number
of the matrix
given by
Open in the MATLAB editor:
f04zd_example
function f04zd_example
fprintf('f04zd example results\n\n');
a = [0.7+0.1i, -0.2+0.0i, 1.0+0.0i, 0.0+0.0i, 0.0+0.0i, 0.1+0.0i;
0.3+0.0i, 0.7+0.0i, 0.0+0.0i, 1.0+0.2i, 0.9+0.0i, 0.2+0.0i;
0.0+5.9i, 0.0+0.0i, 0.2+0.0i, 0.7+0.0i, 0.4+6.1i, 1.1+0.4i;
0.0+0.1i, 0.0+0.1i, -0.7+0.0i, 0.2+0.0i, 0.1+0.0i, 0.1+0.0i;
0.0+0.0i, 4.0+0.0i, 0.0+0.0i, 1.0+0.0i, 9.0+0.0i, 0.0+0.1i;
4.5+6.7i, 0.1+0.4i, 0.0+3.2i, 1.2+0.0i, 0.0+0.0i, 7.8+0.2i];
t = int64(2);
m = 6;
n = 6;
x = complex(zeros(n, t));
y = complex(zeros(m, t));
estnrm = 0;
seed = int64(652);
work = complex(zeros(m*t, 1));
rwork = zeros(2*n, 1);
iwork = zeros(2*n+5*t+20, 1, 'int64');
nrma = norm(a, 1);
[a, ipiv, info] = f07ar(a);
done = false;
irevcm = int64(0);
while ~done
[irevcm, x, y, estnrm, work, rwork, iwork, ifail] = ...
f04zd( ...
irevcm, x, y, estnrm, seed, work, rwork, iwork);
switch irevcm
case 0
done = true;
case 1
[y, info] = f07as('n', a, ipiv, x);
case 2
[x, info] = f07as('t', a, ipiv, y);
otherwise
end
end
fprintf('The norm of a = %6.2f\n', nrma);
fprintf('The estimated norm of inverse(a) = %6.2f\n', estnrm);
fprintf('Estimated condition number of a = %6.2f\n', estnrm*nrma);
f04zd example results
The norm of a = 16.11
The estimated norm of inverse(a) = 24.02
Estimated condition number of a = 387.08
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015