PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_matop_real_gen_matrix_cond_std (f01ja)
Purpose
nag_matop_real_gen_matrix_cond_std (f01ja) computes an estimate of the absolute condition number of a matrix function at a real 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_real_gen_matrix_cond_std (f01ja) 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:
– double 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 and the second dimension of the array
a. (An error is raised if these dimensions are not equal.)
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– double 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 evaluating the matrix function
. Please contact
NAG.
-
-
An internal error occurred when estimating the norm of the Fréchet derivative of
at
. Please contact
NAG.
-
-
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_real_gen_matrix_cond_std (f01ja) uses the norm estimation function
nag_linsys_real_gen_norm_rcomm (f04yd) to estimate a quantity
, where
and
. For further details on the accuracy of norm estimation, see the documentation for
nag_linsys_real_gen_norm_rcomm (f04yd).
Further Comments
The matrix function is computed using one of three underlying matrix function routines:
Approximately of real allocatable memory is required by the routine, in addition to the memory used by these underlying matrix function routines.
If only is required, without an estimate of the condition number, then it is far more efficient to use the appropriate matrix function routine listed above.
nag_matop_complex_gen_matrix_cond_std (f01ka) can be used to find the condition number of the exponential, logarithm, sine, cosine, sinh or cosh matrix functions at a complex matrix.
Example
This example estimates the absolute and relative condition numbers of the matrix sinh function where
Open in the MATLAB editor:
f01ja_example
function f01ja_example
fprintf('f01ja example results\n\n');
a = [2, 1, 3, 1;
3, -1, 0, 2;
1, 0, 3, 1;
1, 2, 0, 3];
fun = 'sinh';
[a, conda, norma, normfa, ifail] = f01ja( ...
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
f01ja example results
f(A) = sinh(A)
Estimated absolute condition number is: 204.45
Estimated relative condition number is: 7.90
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015