|
NAG[f08pkc] NAG[nag_dhsein] - Selected right and/or left eigenvectors of real upper Hessenberg matrix by inverse iteration
|
|
Calling Sequence
f08pkc(side, eig_source, initv, select, h, wr, wi, vl, vr, m, ifaill, ifailr, 'n'=n, 'mm'=mm, 'fail'=fail)
nag_dhsein(. . .)
Parameters
|
side - String;
|
|
|
On entry: indicates whether left and/or right eigenvectors are to be computed.
|
|
Only right eigenvectors are computed.
|
|
Only left eigenvectors are computed.
|
|
Both left and right eigenvectors are computed.
|
|
Constraint: "Nag_RightSide", "Nag_LeftSide" or "Nag_BothSides". .
|
|
|
eig_source - String;
|
|
|
On entry: indicates whether the eigenvalues of (stored in wr and wi) were found using f08pec (nag_dhseqr).
|
|
No such assumption is made and the function performs inverse iteration using the whole matrix.
|
|
Constraint: "Nag_HSEQRSource" or "Nag_NotKnown". .
|
|
|
initv - String;
|
|
|
On entry: indicates whether you are supplying initial estimates for the selected eigenvectors.
|
|
No initial estimates are supplied.
|
|
Initial estimates are supplied in vl and/or vr.
|
|
Constraint: "Nag_NoVec" or "Nag_UserVec". .
|
|
|
select - Vector(1..dim, datatype=boolean);
|
|
|
Note: the dimension, dim, of the array select must be at least .
|
|
On exit: if a complex eigenvector was selected as specified above, then is set to true and to false.
|
|
|
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.
|
|
|
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 entry: the real and imaginary parts, respectively, of the eigenvalues of the matrix . Complex conjugate pairs of values must be stored in consecutive elements of the arrays. If , the arrays must be exactly as returned by f08pec (nag_dhseqr).
|
|
On exit: some elements of wr may be modified, as close eigenvalues are perturbed slightly in searching for independent eigenvectors.
|
|
|
vl - 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.
|
|
If , vl need not be set.
|
|
On exit: if "Nag_LeftSide" or "Nag_BothSides", vl contains the computed left eigenvectors (as specified by select). The eigenvectors are stored consecutively in the rows or columns of the array (depending on the value of storage order), in the same order as their eigenvalues. Corresponding to each selected real eigenvalue is a real eigenvector, occupying one row or column. Corresponding to each selected complex eigenvalue is a complex eigenvector, occupying two rows or columns: the first row or column holds the real part and the second row or column holds the imaginary part.
|
|
If , vl is not referenced.
|
|
|
vr - 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.
|
|
If , vr need not be set.
|
|
On exit: if "Nag_RightSide" or "Nag_BothSides", vr contains the computed right eigenvectors (as specified by select). The eigenvectors are stored consecutively in the rows or columns of the array (depending on the storage order argument), in the same order as their eigenvalues. Corresponding to each selected real eigenvalue is a real eigenvector, occupying one row or column. Corresponding to each selected complex eigenvalue is a complex eigenvector, occupying two rows or columns: the first row or column holds the real part and the second row or column holds the imaginary part.
|
|
If , vr is not referenced.
|
|
|
m - assignable;
|
|
|
Note: On exit the variable m will have a value of type integer.
|
|
On exit: , the number of rows or columns of vl and/or vr required to store the selected eigenvectors.
|
|
|
ifaill - Vector(1..dim, datatype=integer[kernelopts('wordsize')/8]);
|
|
|
Note: the dimension, dim, of the array ifaill must be at least
|
|
when .
|
|
If , ifaill is not referenced.
|
|
|
ifailr - Vector(1..dim, datatype=integer[kernelopts('wordsize')/8]);
|
|
|
Note: the dimension, dim, of the array ifailr must be at least
|
|
when .
|
|
If , ifailr is not referenced.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the dimension of the array h.
|
|
On entry: , the order of the matrix .
|
|
Constraint: . .
|
|
|
'mm'=mm - integer; (optional)
|
|
|
Default value: the second dimension of the arrays vl, vr.
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_dhsein (f08pkc) computes selected left and/or right eigenvectors of a real upper Hessenberg matrix corresponding to specified eigenvalues, by inverse iteration.
|
|
Description
|
|
nag_dhsein (f08pkc) computes left and/or right eigenvectors of a real upper Hessenberg matrix , corresponding to selected eigenvalues.
The right eigenvector , and the left eigenvector , corresponding to an eigenvalue , are defined by:
Note that even though is real, , and may be complex. If is an eigenvector corresponding to a complex eigenvalue , then the complex conjugate vector is the eigenvector corresponding to the complex conjugate eigenvalue .
The eigenvectors are computed by inverse iteration. They are scaled so that, for a real eigenvector , , and for a complex eigenvector, .
If has been formed by reduction of a real general matrix to upper Hessenberg form, then eigenvectors of may be transformed to eigenvectors of by a call to f08ngc (nag_dormhr).
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument had an illegal value.
"NE_CONVERGENCE"
eigenvectors (as indicated by arguments ifaill and/or ifailr) failed to converge. The corresponding columns of vl and/or vr contain no useful information.
"NE_INT"
On entry, . Constraint: , where is obtained by counting 1 for each selected real eigenvector and 2 for each selected complex eigenvector.
On entry, . Constraint: .
"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.
|
|
Accuracy
|
|
Each computed right eigenvector is the exact eigenvector of a nearby matrix , such that . Hence the residual is small:
However eigenvectors corresponding to close or coincident eigenvalues may not accurately span the relevant subspaces.
Similar remarks apply to computed left eigenvectors.
|
|
|
Examples
|
|
>
|
side := "Nag_RightSide":
eig_source := "Nag_HSEQRSource":
initv := "Nag_NoVec":
n := 4:
mm := 4:
selector := Vector([false, true, true, true], datatype=boolean):
h := Matrix([[0.35, -0.1159524296205035, -0.3886010343233214, -0.2941840753473021], [-0.5140038910358559, 0.1224867524602574, 0.1003597896821502, 0.1125618799705319], [-0.728472128292763, 0.644263618527062, -0.1357001717571134, -0.09768162270493334], [0.4139046183481608, -0.1665445794905699, 0.4262443722078448, 0.163213419296856]], datatype=float[8]):
wr := Vector([0.7994821225862075, -0.09941245329507466, -0.09941245329507466, -0.1006572159960585], datatype=float[8]):
wi := Vector([0, 0.4007924719897543, -0.4007924719897543, 0], datatype=float[8]):
vl := Matrix([[0]], datatype=float[8]):
vr := Matrix([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], datatype=float[8]):
ifaill := Vector(1, datatype=integer[kernelopts('wordsize')/8]):
ifailr := Vector(4, datatype=integer[kernelopts('wordsize')/8]):
NAG:-f08pkc(side, eig_source, initv, selector, h, wr, wi, vl, vr, m, ifaill, ifailr, 'n' = n, 'mm' = mm):
|
|
|