PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dtrsna (f08ql)
Purpose
nag_lapack_dtrsna (f08ql) estimates condition numbers for specified eigenvalues and/or right eigenvectors of a real upper quasi-triangular matrix.
Syntax
[
s,
sep,
m,
info] = f08ql(
job,
howmny,
select,
t,
vl,
vr,
mm, 'n',
n)
[
s,
sep,
m,
info] = nag_lapack_dtrsna(
job,
howmny,
select,
t,
vl,
vr,
mm, 'n',
n)
Description
nag_lapack_dtrsna (f08ql) estimates condition numbers for specified eigenvalues and/or right eigenvectors of a real upper quasi-triangular matrix in canonical Schur form. These are the same as the condition numbers of the eigenvalues and right eigenvectors of an original matrix (with orthogonal ), from which may have been derived.
nag_lapack_dtrsna (f08ql) computes the reciprocal of the condition number of an eigenvalue
as
where
and
are the right and left eigenvectors of
, respectively, corresponding to
. This reciprocal condition number always lies between zero (i.e., ill-conditioned) and one (i.e., well-conditioned).
An approximate error estimate for a computed eigenvalue
is then given by
where
is the
machine precision.
To estimate the reciprocal of the condition number of the right eigenvector corresponding to
, the function first calls
nag_lapack_dtrexc (f08qf) to reorder the eigenvalues so that
is in the leading position:
The reciprocal condition number of the eigenvector is then estimated as
, the smallest singular value of the matrix
. This number ranges from zero (i.e., ill-conditioned) to very large (i.e., well-conditioned).
An approximate error estimate for a computed right eigenvector
corresponding to
is then given by
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates whether condition numbers are required for eigenvalues and/or eigenvectors.
- Condition numbers for eigenvalues only are computed.
- Condition numbers for eigenvectors only are computed.
- Condition numbers for both eigenvalues and eigenvectors are computed.
Constraint:
, or .
- 2:
– string (length ≥ 1)
-
Indicates how many condition numbers are to be computed.
- Condition numbers for all eigenpairs are computed.
- Condition numbers for selected eigenpairs (as specified by select) are computed.
Constraint:
or .
- 3:
– logical array
-
The dimension of the array
select
must be at least
if
, and at least
otherwise
Specifies the eigenpairs for which condition numbers are to be computed if
. To select condition numbers for the eigenpair corresponding to the real eigenvalue
,
must be set
true. To select condition numbers corresponding to a complex conjugate pair of eigenvalues
and
,
and/or
must be set to
true.
If
,
select is not referenced.
- 4:
– double array
-
The first dimension of the array
t must be at least
.
The second dimension of the array
t must be at least
.
The
by
upper quasi-triangular matrix
in canonical Schur form, as returned by
nag_lapack_dhseqr (f08pe).
- 5:
– double array
-
The first dimension,
, of the array
vl must satisfy
- if or , ;
- if , .
The second dimension of the array
vl must be at least
if
or
and at least
if
.
If
or
,
vl must contain the left eigenvectors of
(or of any matrix
with
orthogonal) corresponding to the eigenpairs specified by
howmny and
select. The eigenvectors
must be stored in consecutive columns of
vl, as returned by
nag_lapack_dhsein (f08pk) or
nag_lapack_dtrevc (f08qk).
If
,
vl is not referenced.
- 6:
– double array
-
The first dimension,
, of the array
vr must satisfy
- if or , ;
- if , .
The second dimension of the array
vr must be at least
if
or
and at least
if
.
If
or
,
vr must contain the right eigenvectors of
(or of any matrix
with
orthogonal) corresponding to the eigenpairs specified by
howmny and
select. The eigenvectors
must be stored in consecutive columns of
vr, as returned by
nag_lapack_dhsein (f08pk) or
nag_lapack_dtrevc (f08qk).
If
,
vr is not referenced.
- 7:
– int64int32nag_int scalar
-
The number of elements in the arrays
s and
sep, and the number of columns in the arrays
vl and
vr (if used). The precise number required,
, is
if
; if
,
is obtained by counting
for each selected real eigenvalue, and
for each selected complex conjugate pair of eigenvalues (see
select), in which case
.
Constraint:
.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
t and the second dimension of the array
t. (An error is raised if these dimensions are not equal.)
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
The dimension of the array
s will be
if
or
and
otherwise
The reciprocal condition numbers of the selected eigenvalues if
or
, stored in consecutive elements of the array. Thus
,
and the
th columns of
vl and
vr all correspond to the same eigenpair (but not in general the
th eigenpair unless all eigenpairs have been selected). For a complex conjugate pair of eigenvalues, two consecutive elements of
s are set to the same value.
If
,
s is not referenced.
- 2:
– double array
-
The dimension of the array
sep will be
if
or
and
otherwise
The estimated reciprocal condition numbers of the selected right eigenvectors if
or
, stored in consecutive elements of the array. For a complex eigenvector, two consecutive elements of
sep are set to the same value. If the eigenvalues cannot be reordered to compute
, then
is set to zero; this can only occur when the true value would be very small anyway.
If
,
sep is not referenced.
- 3:
– int64int32nag_int scalar
-
, the number of elements of
s and/or
sep actually used to store the estimated condition numbers. If
,
m is set to
.
- 4:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
job, 2:
howmny, 3:
select, 4:
n, 5:
t, 6:
ldt, 7:
vl, 8:
ldvl, 9:
vr, 10:
ldvr, 11:
s, 12:
sep, 13:
mm, 14:
m, 15:
work, 16:
ldwork, 17:
iwork, 18:
info.
It is possible that
info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
Accuracy
The computed values may over estimate the true value, but seldom by a factor of more than .
Further Comments
For a description of canonical Schur form, see the document for
nag_lapack_dhseqr (f08pe).
The complex analogue of this function is
nag_lapack_ztrsna (f08qy).
Example
This example computes approximate error estimates for all the eigenvalues and right eigenvectors of the matrix
, where
Open in the MATLAB editor:
f08ql_example
function f08ql_example
fprintf('f08ql example results\n\n');
n = int64(4);
t = [0.7995, -0.1144, 0.0060, 0.0336;
0, -0.0994, 0.2478, 0.3474;
0, -0.6483, -0.0994, 0.2026;
0, 0, 0, -0.1007];
job = 'Both';
howmny = 'All';
select = [false];
[select, vl, vr, m, info] = ...
f08qk( ...
job, howmny, select, t, zeros(n,n), zeros(n,n), n);
[s, sep, m, info] = f08ql( ...
job, howmny, select, t, vl, vr, m);
disp('s');
disp(s');
disp('sep');
disp(sep');
tnorm = norm(t,1);
disp('Approximate error estimates for eigenvalues of T (machine-dependent)');
fprintf('%11.1e',x02aj*tnorm./s);
fprintf('\n\n%s %s\n', 'Approximate error estimates for right', ...
'eigenvectors (machine-dependent)');
fprintf('%11.1e',x02aj*tnorm./sep);
fprintf('\n');
f08ql example results
s
0.9937 0.7028 0.7028 0.5711
sep
0.6252 0.3743 0.3743 0.3125
Approximate error estimates for eigenvalues of T (machine-dependent)
9.6e-17 1.4e-16 1.4e-16 1.7e-16
Approximate error estimates for right eigenvectors (machine-dependent)
1.5e-16 2.6e-16 2.6e-16 3.1e-16
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015