f08nb computes the eigenvalues and, optionally, the left and/or right eigenvectors for an by real nonsymmetric matrix .
Optionally, it also computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors, reciprocal condition numbers for the eigenvalues, and reciprocal condition numbers for the right eigenvectors.
Syntax
C# |
---|
public static void f08nb( string balanc, string jobvl, string jobvr, string sense, int n, double[,] a, double[] wr, double[] wi, double[,] vl, double[,] vr, out int ilo, out int ihi, double[] scale, out double abnrm, double[] rconde, double[] rcondv, out int info ) |
Visual Basic |
---|
Public Shared Sub f08nb ( _ balanc As String, _ jobvl As String, _ jobvr As String, _ sense As String, _ n As Integer, _ a As Double(,), _ wr As Double(), _ wi As Double(), _ vl As Double(,), _ vr As Double(,), _ <OutAttribute> ByRef ilo As Integer, _ <OutAttribute> ByRef ihi As Integer, _ scale As Double(), _ <OutAttribute> ByRef abnrm As Double, _ rconde As Double(), _ rcondv As Double(), _ <OutAttribute> ByRef info As Integer _ ) |
Visual C++ |
---|
public: static void f08nb( String^ balanc, String^ jobvl, String^ jobvr, String^ sense, int n, array<double,2>^ a, array<double>^ wr, array<double>^ wi, array<double,2>^ vl, array<double,2>^ vr, [OutAttribute] int% ilo, [OutAttribute] int% ihi, array<double>^ scale, [OutAttribute] double% abnrm, array<double>^ rconde, array<double>^ rcondv, [OutAttribute] int% info ) |
F# |
---|
static member f08nb : balanc : string * jobvl : string * jobvr : string * sense : string * n : int * a : float[,] * wr : float[] * wi : float[] * vl : float[,] * vr : float[,] * ilo : int byref * ihi : int byref * scale : float[] * abnrm : float byref * rconde : float[] * rcondv : float[] * info : int byref -> unit |
Parameters
- balanc
- Type: System..::..StringOn entry: indicates how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues.
- Do not diagonally scale or permute.
- Perform permutations to make the matrix more nearly upper triangular. Do not diagonally scale.
- Diagonally scale the matrix, i.e., replace by , where is a diagonal matrix chosen to make the rows and columns of more equal in norm. Do not permute.
- Both diagonally scale and permute .
Computed reciprocal condition numbers will be for the matrix after balancing and/or permuting. Permuting does not change condition numbers (in exact arithmetic), but balancing does.Constraint: , , or .
- jobvl
- Type: System..::..StringOn entry: if , the left eigenvectors of are not computed.If , the left eigenvectors of are computed.If or , jobvl must be set to .Constraint: or .
- jobvr
- Type: System..::..StringOn entry: if , the right eigenvectors of are not computed.If , the right eigenvectors of are computed.If or , jobvr must be set to .Constraint: or .
- sense
- Type: System..::..StringOn entry: determines which reciprocal condition numbers are computed.
- None are computed.
- Computed for eigenvalues only.
- Computed for right eigenvectors only.
- Computed for eigenvalues and right eigenvectors.
If or , both left and right eigenvectors must also be computed ( and ).Constraint: , , or .
- n
- Type: System..::..Int32On entry: , the order of the matrix .Constraint: .
- a
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, dim2]Note: dim1 must satisfy the constraint:Note: the second dimension of the array a must be at least .On entry: the by matrix .On exit: a has been overwritten. If or , contains the real Schur form of the balanced version of the input matrix .
- wr
- Type: array<System..::..Double>[]()[][]An array of size [dim1]
- wi
- Type: array<System..::..Double>[]()[][]An array of size [dim1]
- vl
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, dim2]Note: dim1 must satisfy the constraint:
- if , ;
- otherwise .
Note: the second dimension of the array vl must be at least if , and at least otherwise.
- vr
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, dim2]Note: dim1 must satisfy the constraint:
- if , ;
- otherwise .
Note: the second dimension of the array vr must be at least if , and at least otherwise.
- ilo
- Type: System..::..Int32%
- ihi
- Type: System..::..Int32%
- scale
- Type: array<System..::..Double>[]()[][]An array of size [dim1]Note: the dimension of the array scale must be at least .On exit: details of the permutations and scaling factors applied when balancing .If is the index of the row and column interchanged with row and column , and is the scaling factor applied to row and column , then
- , for ;
- , for ;
- , for .
The order in which the interchanges are made is n to , then to .
- abnrm
- Type: System..::..Double%On exit: the -norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column).
- rconde
- Type: array<System..::..Double>[]()[][]An array of size [dim1]Note: the dimension of the array rconde must be at least .On exit: is the reciprocal condition number of the th eigenvalue.
- rcondv
- Type: array<System..::..Double>[]()[][]An array of size [dim1]Note: the dimension of the array rcondv must be at least .On exit: is the reciprocal condition number of the th right eigenvector.
- info
- Type: System..::..Int32%On exit: unless the method detects an error (see [Error Indicators and Warnings]).
Description
The right eigenvector of satisfies
where is the th eigenvalue of . The left eigenvector of satisfies
where denotes the conjugate transpose of .
Balancing a matrix means permuting the rows and columns to make it more nearly upper triangular, and applying a diagonal similarity transformation , where is a diagonal matrix, with the aim of making its rows and columns closer in norm and the condition numbers of its eigenvalues and eigenvectors smaller. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will. For further explanation of balancing, see Section 4.8.1.2 of Anderson et al. (1999).
Following the optional balancing, the matrix is first reduced to upper Hessenberg form by means of unitary similarity transformations, and the algorithm is then used to further reduce the matrix to upper triangular Schur form, , from which the eigenvalues are computed. Optionally, the eigenvectors of are also computed and backtransformed to those of .
References
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Error Indicators and Warnings
Some error messages may refer to parameters that are dropped from this interface
(LDA, LDVL, LDVR) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
- If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
Accuracy
The computed eigenvalues and eigenvectors are exact for a nearby matrix , where
and is the machine precision. See Section 4.8 of Anderson et al. (1999) for further details.
Parallelism and Performance
None.
Further Comments
Each eigenvector is normalized to have Euclidean norm equal to unity and the element of largest absolute value real and positive.
The total number of floating-point operations is proportional to .
The complex analogue of this method is f08np.
Example
This example finds all the eigenvalues and right eigenvectors of the matrix
together with estimates of the condition number and forward error bounds for each eigenvalue and eigenvector. The option to balance the matrix is used. In order to compute the condition numbers of the eigenvalues, the left eigenvectors also have to be computed, but they are not printed out in this example.
Example program (C#): f08nbe.cs