NAG FL Interface
f02jcf (real_gen_quad)
1
Purpose
f02jcf solves the quadratic eigenvalue problem
where
,
and
are real
by
matrices.
The routine returns the
eigenvalues,
, for
, and can optionally return the corresponding right eigenvectors,
and/or left eigenvectors,
as well as estimates of the condition numbers of the computed eigenvalues and backward errors of the computed right and left eigenvectors. A left eigenvector satisfies the equation
where
is the complex conjugate transpose of
.
is represented as the pair , such that . Note that the computation of may overflow and indeed may be zero.
2
Specification
Fortran Interface
Subroutine f02jcf ( |
scal, jobvl, jobvr, sense, tol, n, a, lda, b, ldb, c, ldc, alphar, alphai, beta, vl, ldvl, vr, ldvr, s, bevl, bevr, iwarn, ifail) |
Integer, Intent (In) |
:: |
scal, sense, n, lda, ldb, ldc, ldvl, ldvr |
Integer, Intent (Inout) |
:: |
ifail |
Integer, Intent (Out) |
:: |
iwarn |
Real (Kind=nag_wp), Intent (In) |
:: |
tol |
Real (Kind=nag_wp), Intent (Inout) |
:: |
a(lda,*), b(ldb,*), c(ldc,*), vl(ldvl,*), vr(ldvr,*), s(*), bevl(*), bevr(*) |
Real (Kind=nag_wp), Intent (Out) |
:: |
alphar(2*n), alphai(2*n), beta(2*n) |
Character (1), Intent (In) |
:: |
jobvl, jobvr |
|
C Header Interface
#include <nag.h>
void |
f02jcf_ (const Integer *scal, const char *jobvl, const char *jobvr, const Integer *sense, const double *tol, const Integer *n, double a[], const Integer *lda, double b[], const Integer *ldb, double c[], const Integer *ldc, double alphar[], double alphai[], double beta[], double vl[], const Integer *ldvl, double vr[], const Integer *ldvr, double s[], double bevl[], double bevr[], Integer *iwarn, Integer *ifail, const Charlen length_jobvl, const Charlen length_jobvr) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
f02jcf_ (const Integer &scal, const char *jobvl, const char *jobvr, const Integer &sense, const double &tol, const Integer &n, double a[], const Integer &lda, double b[], const Integer &ldb, double c[], const Integer &ldc, double alphar[], double alphai[], double beta[], double vl[], const Integer &ldvl, double vr[], const Integer &ldvr, double s[], double bevl[], double bevr[], Integer &iwarn, Integer &ifail, const Charlen length_jobvl, const Charlen length_jobvr) |
}
|
The routine may be called by the names f02jcf or nagf_eigen_real_gen_quad.
3
Description
The quadratic eigenvalue problem is solved by linearizing the problem and solving the resulting by generalized eigenvalue problem. The linearization is chosen to have favourable conditioning and backward stability properties. An initial preprocessing step is performed that reveals and deflates the zero and infinite eigenvalues contributed by singular leading and trailing matrices.
The algorithm is backward stable for problems that are not too heavily damped, that is .
Further details on the algorithm are given in
Hammarling et al. (2013).
4
References
Fan H -Y, Lin W.-W and Van Dooren P. (2004) Normwise scaling of second order polynomial matrices SIAM J. Matrix Anal. Appl. 26, 1 252–256
Gaubert S and Sharify M (2009) Tropical scaling of polynomial matrices Lecture Notes in Control and Information Sciences Series 389 291–303 Springer–Verlag
Hammarling S, Munro C J and Tisseur F (2013) An algorithm for the complete solution of quadratic eigenvalue problems
ACM Trans. Math. Software. 39(3):18:1–18:119 http://eprints.maths.manchester.ac.uk/2061/
5
Arguments
-
1:
– Integer
Input
-
On entry: determines the form of scaling to be performed on
,
and
.
- No scaling.
- (the recommended value)
- Fan, Lin and Van Dooren scaling if and no scaling otherwise where is the Frobenius norm of .
- Fan, Lin and Van Dooren scaling.
- Tropical scaling with largest root.
- Tropical scaling with smallest root.
Constraint:
, , , or .
-
2:
– Character(1)
Input
-
On entry: if
, do not compute left eigenvectors.
If , compute the left eigenvectors.
If
,
,
,
,
or
,
jobvl must be set to 'V'.
Constraint:
or .
-
3:
– Character(1)
Input
-
On entry: if
, do not compute right eigenvectors.
If , compute the right eigenvectors.
If
,
,
,
,
or
,
jobvr must be set to 'V'.
Constraint:
or .
-
4:
– Integer
Input
-
On entry: determines whether, or not, condition numbers and backward errors are computed.
- Do not compute condition numbers, or backward errors.
- Just compute condition numbers for the eigenvalues.
- Just compute backward errors for the left eigenpairs.
- Just compute backward errors for the right eigenpairs.
- Compute backward errors for the left and right eigenpairs.
- Compute condition numbers for the eigenvalues and backward errors for the left eigenpairs.
- Compute condition numbers for the eigenvalues and backward errors for the right eigenpairs.
- Compute condition numbers for the eigenvalues and backward errors for the left and right eigenpairs.
Constraint:
, , , , , , or .
-
5:
– Real (Kind=nag_wp)
Input
-
On entry:
tol is used as the tolerance for making decisions on rank in the deflation procedure. If
tol is zero on entry then
is used in place of
tol, where
machine precision is as returned by routine
x02ajf. A diagonal element of a triangular matrix,
, is regarded as zero if
, or
when
tol is zero, where
is based on the size of the absolute values of the elements of the matrix
containing the matrix
. See
Hammarling et al. (2013) for the motivation. If
tol is
on entry then no deflation is attempted. The recommended value for
tol is zero.
-
6:
– Integer
Input
-
On entry: the order of the matrices , and .
Constraint:
.
-
7:
– Real (Kind=nag_wp) array
Input/Output
-
Note: the second dimension of the array
a
must be at least
.
On entry: the by matrix .
On exit:
a is used as internal workspace, but if
or
,
a is restored on exit.
-
8:
– Integer
Input
-
On entry: the first dimension of the array
a as declared in the (sub)program from which
f02jcf is called.
Constraint:
.
-
9:
– Real (Kind=nag_wp) array
Input/Output
-
Note: the second dimension of the array
b
must be at least
.
On entry: the by matrix .
On exit:
b is used as internal workspace, but is restored on exit.
-
10:
– Integer
Input
-
On entry: the first dimension of the array
b as declared in the (sub)program from which
f02jcf is called.
Constraint:
.
-
11:
– Real (Kind=nag_wp) array
Input/Output
-
Note: the second dimension of the array
c
must be at least
.
On entry: the by matrix .
On exit:
c is used as internal workspace, but if
or
,
c is restored on exit.
-
12:
– Integer
Input
-
On entry: the first dimension of the array
c as declared in the (sub)program from which
f02jcf is called.
Constraint:
.
-
13:
– Real (Kind=nag_wp) array
Output
-
On exit: , for , contains the real part of for the th eigenvalue pair of the quadratic eigenvalue problem.
-
14:
– Real (Kind=nag_wp) array
Output
-
On exit: , for , contains the imaginary part of for the th eigenvalue pair of the quadratic eigenvalue problem. If is zero then the th eigenvalue is real; if is positive then the th and th eigenvalues are a complex conjugate pair, with negative.
-
15:
– Real (Kind=nag_wp) array
Output
-
On exit: , for , contains the second part of the th eigenvalue pair of the quadratic eigenvalue problem, with . Infinite eigenvalues have set to zero.
-
16:
– Real (Kind=nag_wp) array
Output
-
Note: the second dimension of the array
vl
must be at least
if
.
On exit: if
, the left eigenvectors
are stored one after another in the columns of
vl, in the same order as the corresponding eigenvalues. If the
th eigenvalue is real, then
, the
th column of
vl. If the
th and
th eigenvalues form a complex conjugate pair, then
and
. Each eigenvector will be normalized with length unity and with the element of largest modulus real and positive.
If
,
vl is not referenced.
-
17:
– Integer
Input
-
On entry: the first dimension of the array
vl as declared in the (sub)program from which
f02jcf is called.
Constraint:
.
-
18:
– Real (Kind=nag_wp) array
Output
-
Note: the second dimension of the array
vr
must be at least
if
.
On exit: if
, the right eigenvectors
are stored one after another in the columns of
vr, in the same order as the corresponding eigenvalues. If the
th eigenvalue is real, then
, the
th column of
vr. If the
th and
th eigenvalues form a complex conjugate pair, then
and
. Each eigenvector will be normalized with length unity and with the element of largest modulus real and positive.
If
,
vr is not referenced.
-
19:
– Integer
Input
-
On entry: the first dimension of the array
vr as declared in the (sub)program from which
f02jcf is called.
Constraint:
.
-
20:
– Real (Kind=nag_wp) array
Output
-
Note: the dimension of the array
s
must be at least
if
,
,
or
.
also: computing the condition numbers of the eigenvalues requires that both the left and right eigenvectors be computed.
On exit: if
,
,
or
,
contains the condition number estimate for the
th eigenvalue (large condition numbers imply that the problem is near one with multiple eigenvalues). Infinite condition numbers are returned as the largest model real number (
x02alf).
If
,
,
or
,
s is not referenced.
-
21:
– Real (Kind=nag_wp) array
Output
-
Note: the dimension of the array
bevl
must be at least
if
,
,
or
.
On exit: if
,
,
or
,
contains the backward error estimate for the computed left eigenpair
.
If
,
,
or
,
bevl is not referenced.
-
22:
– Real (Kind=nag_wp) array
Output
-
Note: the dimension of the array
bevr
must be at least
if
,
,
or
.
On exit: if
,
,
or
,
contains the backward error estimate for the computed right eigenpair
.
If
,
,
or
,
bevr is not referenced.
-
23:
– Integer
Output
-
On exit:
iwarn will be positive if there are warnings, otherwise
iwarn will be
.
If
then:
- if then one, or both, of the matrices and is zero. In this case no scaling is performed, even if ;
- if then the matrices and are singular, or nearly singular, so the problem is potentially ill-posed;
- if then both the conditions for and above, apply. If , and backward stability cannot be guaranteed.
If
,
iwarn returns the value of
info from
f08xaf.
If
,
iwarn returns the value of
info from
f08waf.
-
24:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended.
When the value or is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
The quadratic matrix polynomial is nonregular (singular).
-
The
iteration failed in
f08xaf.
iwarn returns the value of
info returned by
f08xaf. This failure is unlikely to happen, but if it does, please contact
NAG.
-
The
iteration failed in
f08waf.
iwarn returns the value of
info returned by
f08waf. This failure is unlikely to happen, but if it does, please contact
NAG.
-
On entry, .
Constraint: , , , or .
-
On entry, .
Constraint: or .
On entry, and .
Constraint: when , or ,
when , , , , , or .
-
On entry, .
Constraint: or .
On entry, and .
Constraint: when , or ,
when , , , , , or .
-
On entry, .
Constraint: , , , , , , or .
-
On entry, .
Constraint: .
-
On entry, and .
Constraint: .
-
On entry, and .
Constraint: .
-
On entry, and .
Constraint: .
-
On entry, , and .
Constraint: when , .
-
On entry, , and .
Constraint: when , .
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See
Section 9 in the Introduction to the NAG Library FL Interface for further information.
7
Accuracy
The algorithm is backward stable for problems that are not too heavily damped, that is .
8
Parallelism and Performance
f02jcf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f02jcf 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.
None.
10
Example
To solve the quadratic eigenvalue problem
where
The example also returns the left eigenvectors, condition numbers for the computed eigenvalues and backward errors of the computed right and left eigenpairs.
10.1
Program Text
10.2
Program Data
10.3
Program Results