|
NAG[f08pec] NAG[nag_dhseqr] - Eigenvalues and Schur factorization of real upper Hessenberg matrix reduced from real general matrix
|
|
Calling Sequence
f08pec(job, compz, ilo, ihi, h, wr, wi, z, 'n'=n, 'fail'=fail)
nag_dhseqr(. . .)
Parameters
|
job - String;
|
|
|
On entry: indicates whether eigenvalues only or the Schur form is required.
|
|
Eigenvalues only are required.
|
|
The Schur form is required.
|
|
Constraint: "Nag_EigVals" or "Nag_Schur". .
|
|
|
compz - String;
|
|
|
On entry: indicates whether the Schur vectors are to be computed.
|
|
No Schur vectors are computed (and the array z is not referenced).
|
|
The Schur vectors of are computed (and the array z is initialized by the function).
|
|
Constraint: "Nag_NotZ", "Nag_UpdateZ" or "Nag_InitZ". .
|
|
|
ilo - integer;
ihi - integer;
|
|
|
On entry: if the matrix has been balanced by f08nhc (nag_dgebal), then ilo and ihi must contain the values returned by that function. Otherwise, ilo must be set to 1 and ihi to n.
|
|
Constraint: and . .
|
|
|
h - Matrix(1..dim1, 1..dim2, datatype=float[8], order=order);
|
|
|
Note: this array may be supplied in Fortran_order or C_order , as specified by order. All array parameters must use a consistent order.
|
|
On exit: if , the array contains no useful information.
|
|
|
wr - Vector(1..dim, datatype=float[8]);
wi - Vector(1..dim, datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array wr and wi must be at least .
|
|
On exit: the real and imaginary parts, respectively, of the computed eigenvalues, unless (in which case see Section [Error Indicators and Warnings]). Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having positive imaginary part first. The eigenvalues are stored in the same order as on the diagonal of the Schur form (if computed); see Section [Further Comments] for details.
|
|
|
z - Matrix(1..dim1, 1..dim2, datatype=float[8], order=order);
|
|
|
Note: this array may be supplied in Fortran_order or C_order , as specified by order. All array parameters must use a consistent order.
|
|
On entry: if , z must contain the orthogonal matrix from the reduction to Hessenberg form.
|
|
If , z need not be set.
|
|
If , z is not referenced.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the dimension of the array h.
|
|
On entry: , the order of the matrix .
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_dhseqr (f08pec) computes all the eigenvalues and, optionally, the Schur factorization of a real Hessenberg matrix or a real general matrix which has been reduced to Hessenberg form.
|
|
Description
|
|
nag_dhseqr (f08pec) computes all the eigenvalues and, optionally, the Schur factorization of a real upper Hessenberg matrix :
where is an upper quasi-triangular matrix (the Schur form of ), and is the orthogonal matrix whose columns are the Schur vectors . See Section [Further Comments] for details of the structure of .
The function may also be used to compute the Schur factorization of a real general matrix which has been reduced to upper Hessenberg form :
In this case, after f08nec (nag_dgehrd) has been called to reduce to Hessenberg form, f08nfc (nag_dorghr) must be called to form explicitly; is then passed to nag_dhseqr (f08pec), which must be called with .
The function can also take advantage of a previous call to f08nhc (nag_dgebal) which may have balanced the original matrix before reducing it to Hessenberg form, so that the Hessenberg matrix has the structure:
where and are upper triangular. If so, only the central diagonal block (in rows and columns to ) needs to be further reduced to Schur form (the blocks and are also affected). Therefore the values of and can be supplied to nag_dhseqr (f08pec) directly. Also, f08njc (nag_dgebak) must be called after this function to permute the Schur vectors of the balanced matrix to those of the original matrix. If f08nhc (nag_dgebal) has not been called however, then must be set to 1 and to . Note that if the Schur factorization of is required, f08nhc (nag_dgebal) must not be called with "Nag_Schur" or "Nag_DoBoth", because the balancing transformation is not orthogonal.
nag_dhseqr (f08pec) uses a multishift form of the upper Hessenberg algorithm, due to Bai and Demmel (1989). The Schur vectors are normalized so that , but are determined only to within a factor .
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_CONVERGENCE"
The algorithm has failed to find all the eigenvalues after a total of iterations.
"NE_INT"
On entry, . Constraint: .
"NE_INT_3"
On entry, , , . Constraint: and .
"NE_INTERNAL_ERROR"
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please consult NAG for assistance.
|
|
|
Examples
|
|
>
|
job := "Nag_Schur":
compz := "Nag_InitZ":
n := 4:
ilo := 1:
ihi := 4:
h := Matrix([[0.35, -0.116, -0.3886, -0.2942], [-0.514, 0.1225, 0.1004, 0.1126], [0, 0.6443, -0.1357, -0.0977], [0, 0, 0.4262, 0.1632]], datatype=float[8]):
wr := Vector(4, datatype=float[8]):
wi := Vector(4, datatype=float[8]):
z := Matrix([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], datatype=float[8]):
NAG:-f08pec(job, compz, ilo, ihi, h, wr, wi, z, 'n' = n):
|
|
|
See Also
|
|
Bai Z and Demmel J W (1989) On a block implementation of Hessenberg multishift iteration Internat. J. High Speed Comput. 1 97–112
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
f08 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|