NAG Library Routine Document
f08qyf (ztrsna)
1
Purpose
f08qyf (ztrsna) estimates condition numbers for specified eigenvalues and/or right eigenvectors of a complex upper triangular matrix.
2
Specification
Fortran Interface
Subroutine f08qyf ( |
job, howmny, select, n, t, ldt, vl, ldvl, vr, ldvr, s, sep, mm, m, work, ldwork, rwork, info) |
Integer, Intent (In) | :: | n, ldt, ldvl, ldvr, mm, ldwork | Integer, Intent (Out) | :: | m, info | Real (Kind=nag_wp), Intent (Inout) | :: | s(*), sep(*), rwork(*) | Complex (Kind=nag_wp), Intent (In) | :: | t(ldt,*), vl(ldvl,*), vr(ldvr,*) | Complex (Kind=nag_wp), Intent (Inout) | :: | work(ldwork,*) | Logical, Intent (In) | :: | select(*) | Character (1), Intent (In) | :: | job, howmny |
|
C Header Interface
#include <nagmk26.h>
void |
f08qyf_ (const char *job, const char *howmny, const logical sel[], const Integer *n, const Complex t[], const Integer *ldt, const Complex vl[], const Integer *ldvl, const Complex vr[], const Integer *ldvr, double s[], double sep[], const Integer *mm, Integer *m, Complex work[], const Integer *ldwork, double rwork[], Integer *info, const Charlen length_job, const Charlen length_howmny) |
|
The routine may be called by its
LAPACK
name ztrsna.
3
Description
f08qyf (ztrsna) estimates condition numbers for specified eigenvalues and/or right eigenvectors of a complex upper triangular matrix . These are the same as the condition numbers of the eigenvalues and right eigenvectors of an original matrix (with unitary ), from which may have been derived.
f08qyf (ztrsna) 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 routine first calls
f08qtf (ztrexc) 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
4
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
5
Arguments
- 1: – Character(1)Input
-
On entry: 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: – Character(1)Input
-
On entry: 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 arrayInput
-
Note: the dimension of the array
select
must be at least
if
, and at least
otherwise.
On entry: specifies the eigenpairs for which condition numbers are to be computed if
. To select condition numbers for the eigenpair corresponding to the eigenvalue
,
must be set to .TRUE..
If
,
select is not referenced.
- 4: – IntegerInput
-
On entry: , the order of the matrix .
Constraint:
.
- 5: – Complex (Kind=nag_wp) arrayInput
-
Note: the second dimension of the array
t
must be at least
.
On entry: the
by
upper triangular matrix
, as returned by
f08psf (zhseqr).
- 6: – IntegerInput
-
On entry: the first dimension of the array
t as declared in the (sub)program from which
f08qyf (ztrsna) is called.
Constraint:
.
- 7: – Complex (Kind=nag_wp) arrayInput
-
Note: the second dimension of the array
vl
must be at least
if
or
.
On entry: if
or
,
vl must contain the left eigenvectors of
(or of any matrix
with
unitary) corresponding to the eigenpairs specified by
howmny and
select. The eigenvectors
must be stored in consecutive columns of
vl, as returned by
f08pxf (zhsein) or
f08qxf (ztrevc).
If
,
vl is not referenced.
- 8: – IntegerInput
-
On entry: the first dimension of the array
vl as declared in the (sub)program from which
f08qyf (ztrsna) is called.
Constraints:
- if or , ;
- if , .
- 9: – Complex (Kind=nag_wp) arrayInput
-
Note: the second dimension of the array
vr
must be at least
if
or
.
On entry: if
or
,
vr must contain the right eigenvectors of
(or of any matrix
with
unitary) corresponding to the eigenpairs specified by
howmny and
select. The eigenvectors
must be stored in consecutive columns of
vr, as returned by
f08pxf (zhsein) or
f08qxf (ztrevc).
If
,
vr is not referenced.
- 10: – IntegerInput
-
On entry: the first dimension of the array
vr as declared in the (sub)program from which
f08qyf (ztrsna) is called.
Constraints:
- if or , ;
- if , .
- 11: – Real (Kind=nag_wp) arrayOutput
-
Note: the dimension of the array
s
must be at least
if
or
.
On exit: 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).
If
,
s is not referenced.
- 12: – Real (Kind=nag_wp) arrayOutput
-
Note: the dimension of the array
sep
must be at least
if
or
, and at least
otherwise.
On exit: the estimated reciprocal condition numbers of the selected right eigenvectors if
or
, stored in consecutive elements of the array.
If
,
sep is not referenced.
- 13: – IntegerInput
-
On entry: 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 the number of selected eigenpairs (see
select), in which case
.
Constraints:
- if , ;
- otherwise .
- 14: – IntegerOutput
-
On exit:
, the number of selected eigenpairs. If
,
m is set to
.
- 15: – Complex (Kind=nag_wp) arrayWorkspace
-
Note: the second dimension of the array
work
must be at least
if
or
and at least
if
.
If
,
work is not referenced.
- 16: – IntegerInput
-
On entry: the first dimension of the array
work as declared in the (sub)program from which
f08qyf (ztrsna) is called.
Constraints:
- if or , ;
- if , .
- 17: – Real (Kind=nag_wp) arrayWorkspace
-
Note: the dimension of the array
rwork
must be at least
.
- 18: – IntegerOutput
On exit:
unless the routine detects an error (see
Section 6).
6
Error Indicators and Warnings
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
7
Accuracy
The computed values may over estimate the true value, but seldom by a factor of more than .
8
Parallelism and Performance
f08qyf (ztrsna) 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 real analogue of this routine is
f08qlf (dtrsna).
10
Example
This example computes approximate error estimates for all the eigenvalues and right eigenvectors of the matrix
, where
10.1
Program Text
Program Text (f08qyfe.f90)
10.2
Program Data
Program Data (f08qyfe.d)
10.3
Program Results
Program Results (f08qyfe.r)