NAG Library Routine Document

f02jqf (complex_gen_quad)

1
Purpose

f02jqf solves the quadratic eigenvalue problem
λ2 A + λ B + C x = 0 ,  
where A, B and C are complex n by n matrices.
The routine returns the 2n eigenvalues, λj, for j=1,2,,2n, and can optionally return the corresponding right eigenvectors, xj and/or left eigenvectors, yj 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
yH λ2A+ λB+ C = 0 ,  
where yH is the complex conjugate transpose of y.
λ is represented as the pair α,β , such that λ = α/β. Note that the computation of α/β may overflow and indeed β may be zero.

2
Specification

Fortran Interface
Subroutine f02jqf ( scal, jobvl, jobvr, sense, tol, n, a, lda, b, ldb, c, ldc, alpha, 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):: s(*), bevl(*), bevr(*)
Complex (Kind=nag_wp), Intent (Inout):: a(lda,*), b(ldb,*), c(ldc,*), vl(ldvl,*), vr(ldvr,*)
Complex (Kind=nag_wp), Intent (Out):: alpha(2*n), beta(2*n)
Character (1), Intent (In):: jobvl, jobvr
C Header Interface
#include <nagmk26.h>
void  f02jqf_ (const Integer *scal, const char *jobvl, const char *jobvr, const Integer *sense, const double *tol, const Integer *n, Complex a[], const Integer *lda, Complex b[], const Integer *ldb, Complex c[], const Integer *ldc, Complex alpha[], Complex beta[], Complex vl[], const Integer *ldvl, Complex vr[], const Integer *ldvr, double s[], double bevl[], double bevr[], Integer *iwarn, Integer *ifail, const Charlen length_jobvl, const Charlen length_jobvr)

3
Description

The quadratic eigenvalue problem is solved by linearizing the problem and solving the resulting 2n by 2n 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 B10A·C.
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:     scal – IntegerInput
On entry: determines the form of scaling to be performed on A, B and C.
scal=0
No scaling.
scal=1 (the recommended value)
Fan, Lin and Van Dooren scaling if B A×C <10  and no scaling otherwise where Z is the Frobenius norm of Z.
scal=2
Fan, Lin and Van Dooren scaling.
scal=3
Tropical scaling with largest root.
scal=4
Tropical scaling with smallest root.
Constraint: scal=0, 1, 2, 3 or 4.
2:     jobvl – Character(1)Input
On entry: if jobvl='N', do not compute left eigenvectors.
If jobvl='V', compute the left eigenvectors.
If sense=1, 2, 4, 5, 6 or 7, jobvl must be set to 'V'.
Constraint: jobvl='N' or 'V'.
3:     jobvr – Character(1)Input
On entry: if jobvr='N', do not compute right eigenvectors.
If jobvr='V', compute the right eigenvectors.
If sense=1, 3, 4, 5, 6 or 7, jobvr must be set to 'V'.
Constraint: jobvr='N' or 'V'.
4:     sense – IntegerInput
On entry: determines whether, or not, condition numbers and backward errors are computed.
sense=0
Do not compute condition numbers, or backward errors.
sense=1
Just compute condition numbers for the eigenvalues.
sense=2
Just compute backward errors for the left eigenpairs.
sense=3
Just compute backward errors for the right eigenpairs.
sense=4
Compute backward errors for the left and right eigenpairs.
sense=5
Compute condition numbers for the eigenvalues and backward errors for the left eigenpairs.
sense=6
Compute condition numbers for the eigenvalues and backward errors for the right eigenpairs.
sense=7
Compute condition numbers for the eigenvalues and backward errors for the left and right eigenpairs.
Constraint: sense=0, 1, 2, 3, 4, 5, 6 or 7.
5:     tol – 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 n× machine precision  is used in place of tol, where machine precision is as returned by routine x02ajf. A diagonal element of a triangular matrix, R, is regarded as zero if rjj tol×sizeX, or n×machine precision×sizeX when tol is zero, where sizeX is based on the size of the absolute values of the elements of the matrix X containing the matrix R. See Hammarling et al. (2013) for the motivation. If tol is -1.0 on entry then no deflation is attempted. The recommended value for tol is zero.
6:     n – IntegerInput
On entry: the order of the matrices A, B and C.
Constraint: n0.
7:     alda* – Complex (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array a must be at least n.
On entry: the n by n matrix A.
On exit: a is used as internal workspace, but if jobvl='V' or jobvr='V', a is restored on exit.
8:     lda – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f02jqf is called.
Constraint: ldan.
9:     bldb* – Complex (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array b must be at least n.
On entry: the n by n matrix B.
On exit: b is used as internal workspace, but is restored on exit.
10:   ldb – IntegerInput
On entry: the first dimension of the array b as declared in the (sub)program from which f02jqf is called.
Constraint: ldbn.
11:   cldc* – Complex (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array c must be at least n.
On entry: the n by n matrix C.
On exit: c is used as internal workspace, but if jobvl='V' or jobvr='V', c is restored on exit.
12:   ldc – IntegerInput
On entry: the first dimension of the array c as declared in the (sub)program from which f02jqf is called.
Constraint: ldcn.
13:   alpha2×n – Complex (Kind=nag_wp) arrayOutput
On exit: alphaj, for j=1,2,,2n, contains the first part of the the jth eigenvalue pair αj,βj  of the quadratic eigenvalue problem.
14:   beta2×n – Complex (Kind=nag_wp) arrayOutput
On exit: betaj, for j=1,2,,2n, contains the second part of the jth eigenvalue pair αj,βj  of the quadratic eigenvalue problem. Although beta is declared complex, it is actually real and non-negative. Infinite eigenvalues have βj set to zero.
15:   vlldvl* – Complex (Kind=nag_wp) arrayOutput
Note: the second dimension of the array vl must be at least 2×n if jobvl='V'.
On exit: if jobvl='V', the left eigenvectors yj are stored one after another in the columns of vl, in the same order as the corresponding eigenvalues. Each eigenvector will be normalized with length unity and with the element of largest modulus real and positive.
If jobvl='N', vl is not referenced.
16:   ldvl – IntegerInput
On entry: the first dimension of the array vl as declared in the (sub)program from which f02jqf is called.
Constraint: ldvln.
17:   vrldvr* – Complex (Kind=nag_wp) arrayOutput
Note: the second dimension of the array vr must be at least 2×n if jobvr='V'.
On exit: if jobvr='V', the right eigenvectors xj are stored one after another in the columns of vr, in the same order as the corresponding eigenvalues. Each eigenvector will be normalized with length unity and with the element of largest modulus real and positive.
If jobvr='N', vr is not referenced.
18:   ldvr – IntegerInput
On entry: the first dimension of the array vr as declared in the (sub)program from which f02jqf is called.
Constraint: ldvrn.
19:   s* – Real (Kind=nag_wp) arrayOutput
Note: the dimension of the array s must be at least 2×n if sense=1, 5, 6 or 7.
Also: computing the condition numbers of the eigenvalues requires that both the left and right eigenvectors be computed.
On exit: if sense=1, 5, 6 or 7, sj contains the condition number estimate for the jth 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 sense=0, 2, 3 or 4, s is not referenced.
20:   bevl* – Real (Kind=nag_wp) arrayOutput
Note: the dimension of the array bevl must be at least 2×n if sense=2, 4, 5 or 7.
On exit: if sense=2, 4, 5 or 7, bevlj contains the backward error estimate for the computed left eigenpair λj,yj .
If sense=0, 1, 3 or 6, bevl is not referenced.
21:   bevr* – Real (Kind=nag_wp) arrayOutput
Note: the dimension of the array bevr must be at least 2×n if sense=3, 4, 6 or 7.
On exit: if sense=3, 4, 6 or 7, bevrj contains the backward error estimate for the computed right eigenpair λj,xj .
If sense=0, 1, 2 or 5, bevr is not referenced.
22:   iwarn – IntegerOutput
On exit: iwarn will be positive if there are warnings, otherwise iwarn will be 0.
If ifail=0 then:
  • if iwarn=1 then one, or both, of the matrices A and C is zero. In this case no scaling is performed, even if scal>0;
  • if iwarn=2 then the matrices A and C are singular, or nearly singular, so the problem is potentially ill-posed;
  • if iwarn=3 then both the conditions for iwarn=1 and iwarn=2 above, apply. If iwarn=4, b10A·C and backward stability cannot be guaranteed.
If ifail=2, iwarn returns the value of info from f08xnf (zgges).
If ifail=3, iwarn returns the value of info from f08wnf (zggev).
23:   ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6
Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
The quadratic matrix polynomial is nonregular (singular).
ifail=2
The QZ iteration failed in f08xnf (zgges).
iwarn returns the value of info returned by f08xnf (zgges). This failure is unlikely to happen, but if it does, please contact NAG.
ifail=3
The QZ iteration failed in f08wnf (zggev).
iwarn returns the value of info returned by f08wnf (zggev). This failure is unlikely to happen, but if it does, please contact NAG.
ifail=-1
On entry, scal=value.
Constraint: scal=0, 1, 2, 3 or 4.
ifail=-2
On entry, jobvl=value.
Constraint: jobvl='N' or 'V'.
On entry, sense=value and jobvl=value.
Constraint: when jobvl='N', sense=0 or 3,
when jobvl='V', sense=1, 2, 4, 5, 6 or 7.
ifail=-3
On entry, jobvr=value.
Constraint: jobvr='N' or 'V'.
On entry, sense=value and jobvr=value.
Constraint: when jobvr='N', sense=0 or 2,
when jobvr='V', sense=1, 3, 4, 5, 6 or 7.
ifail=-4
On entry, sense=value.
Constraint: sense=0, 1, 2, 3, 4, 5, 6 or 7.
ifail=-6
On entry, n=value.
Constraint: n0.
ifail=-8
On entry, lda=value and n=value.
Constraint: ldan.
ifail=-10
On entry, ldb=value and n=value.
Constraint: ldbn.
ifail=-12
On entry, ldc=value and n=value.
Constraint: ldcn.
ifail=-16
On entry, ldvl=value, n=value and jobvl=value.
Constraint: when jobvl='V', ldvln.
ifail=-18
On entry, ldvr=value, n=value and jobvr=value.
Constraint: when jobvr='V', ldvrn.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

The algorithm is backward stable for problems that are not too heavily damped, that is B A·C .

8
Parallelism and Performance

f02jqf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f02jqf 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.

9
Further Comments

None.

10
Example

To solve the quadratic eigenvalue problem
λ2 A + λB + C x = 0  
where
A = 2i 4i 4i 6i 2i 2i 6i 4i 2i ,  B = 3+3i 2+2i 1+1i 2+2i 1+1i 3+3i 1+1i 3+3i 2+2i  and  C = 1 1 2 2 3 1 3 1 2 .  
The example also returns the left eigenvectors, condition numbers for the computed eigenvalues and the maximum backward errors of the computed right and left eigenpairs.

10.1
Program Text

Program Text (f02jqfe.f90)

10.2
Program Data

Program Data (f02jqfe.d)

10.3
Program Results

Program Results (f02jqfe.r)