NAG FL Interface
f08wff (dgghd3)

1 Purpose

f08wff reduces a pair of real matrices A,B, where B is upper triangular, to the generalized upper Hessenberg form using orthogonal transformations.

2 Specification

Fortran Interface
Subroutine f08wff ( compq, compz, n, ilo, ihi, a, lda, b, ldb, q, ldq, z, ldz, work, lwork, info)
Integer, Intent (In) :: n, ilo, ihi, lda, ldb, ldq, ldz, lwork
Integer, Intent (Out) :: info
Real (Kind=nag_wp), Intent (Inout) :: a(lda,*), b(ldb,*), q(ldq,*), z(ldz,*)
Real (Kind=nag_wp), Intent (Out) :: work(max(1,lwork))
Character (1), Intent (In) :: compq, compz
C Header Interface
#include <nag.h>
void  f08wff_ (const char *compq, const char *compz, const Integer *n, const Integer *ilo, const Integer *ihi, double a[], const Integer *lda, double b[], const Integer *ldb, double q[], const Integer *ldq, double z[], const Integer *ldz, double work[], const Integer *lwork, Integer *info, const Charlen length_compq, const Charlen length_compz)
The routine may be called by the names f08wff, nagf_lapackeig_dgghd3 or its LAPACK name dgghd3.

3 Description

f08wff is the third step in the solution of the real generalized eigenvalue problem
Ax=λBx.  
The (optional) first step balances the two matrices using f08whf. In the second step, matrix B is reduced to upper triangular form using the QR factorization routine f08aef and this orthogonal transformation Q is applied to matrix A by calling f08agf. The driver, f08wcf, solves the real generalized eigenvalue problem by combining all the required steps including those just listed.
f08wff reduces a pair of real matrices A,B, where B is upper triangular, to the generalized upper Hessenberg form using orthogonal transformations. This two-sided transformation is of the form
QTAZ=H, QTBZ=T  
where H is an upper Hessenberg matrix, T is an upper triangular matrix and Q and Z are orthogonal matrices determined as products of Givens rotations. They may either be formed explicitly, or they may be postmultiplied into input matrices Q1 and Z1, so that
Q1AZ1T=Q1QHZ1ZT, Q1BZ1T=Q1QTZ1ZT.  

4 References

Golub G H and Van Loan C F (2012) Matrix Computations (4th Edition) Johns Hopkins University Press, Baltimore
Moler C B and Stewart G W (1973) An algorithm for generalized matrix eigenproblems SIAM J. Numer. Anal. 10 241–256

5 Arguments

1: compq Character(1) Input
On entry: specifies the form of the computed orthogonal matrix Q.
compq='N'
Do not compute Q.
compq='I'
The orthogonal matrix Q is returned.
compq='V'
q must contain an orthogonal matrix Q1, and the product Q1Q is returned.
Constraint: compq='N', 'I' or 'V'.
2: compz Character(1) Input
On entry: specifies the form of the computed orthogonal matrix Z.
compz='N'
Do not compute Z.
compz='I'
The orthogonal matrix Z is returned.
compz='V'
z must contain an orthogonal matrix Z1, and the product Z1Z is returned.
Constraint: compz='N', 'V' or 'I'.
3: n Integer Input
On entry: n, the order of the matrices A and B.
Constraint: n0.
4: ilo Integer Input
5: ihi Integer Input
On entry: ilo and ihi as determined by a previous call to f08whf. Otherwise, they should be set to 1 and n, respectively.
Constraints:
  • if n>0, 1 ilo ihi n ;
  • if n=0, ilo=1 and ihi=0.
6: alda* Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array a must be at least max1,n.
On entry: the matrix A of the matrix pair A,B. Usually, this is the matrix A returned by f08agf.
On exit: a is overwritten by the upper Hessenberg matrix H.
7: lda Integer Input
On entry: the first dimension of the array a as declared in the (sub)program from which f08wff is called.
Constraint: ldamax1,n.
8: bldb* Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array b must be at least max1,n.
On entry: the upper triangular matrix B of the matrix pair A,B. Usually, this is the matrix B returned by the QR factorization routine f08aef.
On exit: b is overwritten by the upper triangular matrix T.
9: ldb Integer Input
On entry: the first dimension of the array b as declared in the (sub)program from which f08wff is called.
Constraint: ldbmax1,n.
10: qldq* Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array q must be at least max1,n if compq='I' or 'V' and at least 1 if compq='N'.
On entry: if compq='V', q must contain an orthogonal matrix Q1.
If compq='N', q is not referenced.
On exit: if compq='I', q contains the orthogonal matrix Q.
If compq='V', q is overwritten by Q1Q.
11: ldq Integer Input
On entry: the first dimension of the array q as declared in the (sub)program from which f08wff is called.
Constraints:
  • if compq='I' or 'V', ldq max1,n ;
  • if compq='N', ldq1.
12: zldz* Real (Kind=nag_wp) array Input/Output
Note: the second dimension of the array z must be at least max1,n if compz='V' or 'I' and at least 1 if compz='N'.
On entry: if compz='V', z must contain an orthogonal matrix Z1.
If compz='N', z is not referenced.
On exit: if compz='I', z contains the orthogonal matrix Z.
If compz='V', z is overwritten by Z1Z.
13: ldz Integer Input
On entry: the first dimension of the array z as declared in the (sub)program from which f08wff is called.
Constraints:
  • if compz='V' or 'I', ldz max1,n ;
  • if compz='N', ldz1.
14: workmax1,lwork Real (Kind=nag_wp) array Workspace
On exit: if info=0, work1 contains the minimum value of lwork required for optimal performance.
15: lwork Integer Input
On entry: the dimension of the array work as declared in the (sub)program from which f08wff is called.
If lwork=-1, a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued.
Suggested value: for optimal performance, lwork must generally be larger than the minimum; increase workspace by, say, 6×nb×n, where nb is the optimal block size.
16: info Integer Output
On exit: info=0 unless the routine detects an error (see Section 6).

6 Error Indicators and Warnings

info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

7 Accuracy

The reduction to the generalized Hessenberg form is implemented using orthogonal transformations which are backward stable.

8 Parallelism and Performance

f08wff 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

This routine is usually followed by f08xef which implements the QZ algorithm for computing generalized eigenvalues of a reduced pair of matrices.
The complex analogue of this routine is f08wtf.

10 Example

See Section 10 in f08xef and f08ykf.