PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_complex_gen_matrix_cond_std (f01ka)
Purpose
nag_matop_complex_gen_matrix_cond_std (f01ka) computes an estimate of the absolute condition number of a matrix function of a complex by matrix in the -norm, where is either the exponential, logarithm, sine, cosine, hyperbolic sine (sinh) or hyperbolic cosine (cosh). The evaluation of the matrix function, , is also returned.
Syntax
Description
The absolute condition number of
at
,
is given by the norm of the Fréchet derivative of
,
, which is defined by
where
is the Fréchet derivative in the direction
.
is linear in
and can therefore be written as
where the
operator stacks the columns of a matrix into one vector, so that
is
.
nag_matop_complex_gen_matrix_cond_std (f01ka) computes an estimate
such that
, where
. The relative condition number can then be computed via
The algorithm used to find
is detailed in Section 3.4 of
Higham (2008).
References
Higham N J (2008) Functions of Matrices: Theory and Computation SIAM, Philadelphia, PA, USA
Parameters
Compulsory Input Parameters
- 1:
– string
-
Indicates which matrix function will be used.
- The matrix exponential, , will be used.
- The matrix sine, , will be used.
- The matrix cosine, , will be used.
- The hyperbolic matrix sine, , will be used.
- The hyperbolic matrix cosine, , will be used.
- The matrix logarithm, , will be used.
Constraint:
, , , , or .
- 2:
– complex array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
The by matrix .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a.
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– complex array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
The by matrix, .
- 2:
– double scalar
-
An estimate of the absolute condition number of at .
- 3:
– double scalar
-
The -norm of .
- 4:
– double scalar
-
The -norm of .
- 5:
– 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:
-
-
An internal error occurred when estimating the norm of the Fréchet derivative of
at
. Please contact
NAG.
-
-
An internal error occurred when evaluating the matrix function
. You can investigate further by calling
nag_matop_complex_gen_matrix_exp (f01fc),
nag_matop_complex_gen_matrix_log (f01fj) or
nag_matop_complex_gen_matrix_fun_std (f01fk) with the matrix
.
-
-
On entry, was an illegal value.
-
-
On entry, .
Input argument number is invalid.
-
-
On entry, argument lda is invalid.
Constraint: .
-
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
nag_matop_complex_gen_matrix_cond_std (f01ka) uses the norm estimation function
nag_linsys_complex_gen_norm_rcomm (f04zd) to estimate a quantity
, where
and
. For further details on the accuracy of norm estimation, see the documentation for
nag_linsys_complex_gen_norm_rcomm (f04zd).
Further Comments
Approximately
of complex allocatable memory is required by the routine, in addition to the memory used by the underlying matrix function routines
nag_matop_complex_gen_matrix_exp (f01fc),
nag_matop_complex_gen_matrix_log (f01fj) or
nag_matop_complex_gen_matrix_fun_std (f01fk).
nag_matop_complex_gen_matrix_cond_std (f01ka) returns the matrix function
. This is computed using
nag_matop_complex_gen_matrix_exp (f01fc) if
,
nag_matop_complex_gen_matrix_log (f01fj) if
and
nag_matop_complex_gen_matrix_fun_std (f01fk) otherwise. If only
is required, without an estimate of the condition number, then it is far more efficient to use
nag_matop_complex_gen_matrix_exp (f01fc),
nag_matop_complex_gen_matrix_log (f01fj) or
nag_matop_complex_gen_matrix_fun_std (f01fk) directly.
nag_matop_real_gen_matrix_cond_std (f01ja) can be used to find the condition number of the exponential, logarithm, sine, cosine, sinh or cosh at a real matrix.
Example
This example estimates the absolute and relative condition numbers of the matrix sinh function for
Open in the MATLAB editor:
f01ka_example
function f01ka_example
fprintf('f01ka example results\n\n');
a = [0+1i, -1+0i, 1+0i, 2+0i;
2+1i, 0-1i, 0+0i, 1+0i;
0+1i, 0+0i, 1+1i, 0+2i;
1+0i, 2+0i, -2+3i, 0+1i];
fun = 'sinh';
[a, conda, norma, normfa, ifail] = ...
f01ka(fun, a);
fprintf('\nf(A) = %s(A)\n', fun);
fprintf('Estimated absolute condition number is: %7.2f\n', conda);
eps = x02aj;
if normfa > eps
cond_rel = conda*norma/normfa;
fprintf('Estimated relative condition number is: %7.2f\n', cond_rel);
else
fprintf('The estimated norm of f(A) is effectively zero;\n');
fprintf('the relative condition number is therefore undefined.\n');
end
f01ka example results
f(A) = sinh(A)
Estimated absolute condition number is: 7.33
Estimated relative condition number is: 4.94
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015