Computes the generalized eigenvalues of an n × n matrix pencil, Av = λBv. Optionally, the generalized eigenvectors are computed. If either of A or B is nonsingular, there are diagonal matrices α and β, and a complex matrix V, all computed such that AVβ = BVα.
Required Arguments
A — Array of size n × n containing the matrix A. (Input [/Output])
B — Array of size n × n containing the matrix B. (Input [/Output])
ALPHA — Array of size n containing diagonal matrix factors of the generalized eigenvalues. These complex values are in order of decreasing absolute value. (Output)
BETAV — Array of size n containing diagonal matrix factors of the generalized eigenvalues. These real values are in order of decreasing value. (Output)
Optional Arguments
NROWS= n (Input) Uses arrays A(1:n, 1:n) and B(1:n, 1:n) for the input matrix pencil. Default: n = SIZE(A, 1)
v= V(:,:) (Output) Returns the complex array of generalized eigenvectors for the matrix pencil.
iopt= iopt(:) (Input) Derived type array with the same precision as the input matrix. Used for passing optional data to the routine. The options are as follows:
Packaged Options for LIN_GEIG_GEN
Option Prefix = ?
Option Name
Option Value
s_, d_, c_, z_
lin_geig_gen_set_small
1
s_, d_, c_, z_
lin_geig_gen_overwrite_input
2
s_, d_, c_, z_
lin_geig_gen_scan_for_NaN
3
s_, d_, c_, z_
lin_geig_gen_self_adj_pos
4
s_, d_, c_, z_
lin_geig_gen_for_lin_sol_self
5
s_, d_, c_, z_
lin_geig_gen_for_lin_eig_self
6
s_, d_, c_, z_
lin_geig_gen_for_lin_sol_lsq
7
s_, d_, c_, z_
lin_geig_gen_for_lin_eig_gen
8
iopt(IO)= ?_options(?_lin_geig_gen_set_small, Small) This tolerance, multiplied by the sum of absolute value of the matrix B, is used to define a small diagonal term in the routines lin_sol_lsqandlin_sol_self. That value can be replaced using the option flags lin_geig_gen_for_lin_sol_lsq, and lin_geig_gen_for_lin_sol_self. Default: Small = epsilon(.), the relative accuracy of arithmetic.
iopt(IO)= ?_options(?_lin_geig_gen_overwrite_input, ?_dummy) Does not save the input arrays A(:, :) and B(:, :). Default: The array is saved.
iopt(IO)= ?_options(?_lin_geig_gen_scan_for_NaN, ?_dummy) Examines each input array entry to find the first value such that
isNaN(a(i,j)) .or. isNaN(b(i,j)) == .true.
See the isNaN() function, Chapter 10. Default: The arrays are not scanned for NaNs.
iopt(IO)= ?_options(?_lin_geig_gen_self_adj_pos, ?_dummy) If both matrices A and B are self-adjoint and additionally B is positive-definite, then the Cholesky algorithm is used to reduce the matrix pencil to an ordinary self-adjoint eigenvalue problem.
Specific: The specific interface names are S_LIN_GEIG_GEN, D_LIN_GEIG_GEN, C_LIN_GEIG_GEN, and Z_LIN_GEIG_GEN.
Description
Routine LIN_GEIG_GEN implements a standard algorithm that reduces a generalized eigenvalue or matrix pencil problem to an ordinary eigenvalue problem. An orthogonal decomposition is computed
BPT=HR
The orthogonal matrix H is the product of n – 1 row permutations, each followed by a Householder transformation. Column permutations, P, are chosen at each step to maximize the Euclidian length of the pivot column. The matrix R is upper triangular. Using the default tolerance = ɛ∥B∥, where ɛ is machine relative precision, each diagonal entry of R exceeds in value. Otherwise, R is singular. In that case A and B are interchanged and the orthogonal decomposition is computed one more time. If both matrices are singular the problem is declared singular and is not solved. The interchange of A and B is accounted for in the output diagonal matrices α and β. The ordinary eigenvalue problem is Cx = λx, where
C =HTAPTR-1
and
RPv = x
If the matrices A and B are self-adjoint and if, in addition, B is positive-definite, then a more efficient reduction than the default algorithm can be optionally used to solve the problem: A Cholesky decomposition is obtained, RTR R = PBPT. The matrix R is upper triangular and P is a permutation matrix. This is equivalent to the ordinary self-adjoint eigenvalue problem Cx = λx, where RPv = x and
C =R-TPAPTR-1
The self-adjoint eigenvalue problem is then solved.
Fatal, Terminal, and Warning Error Messages
See the messages.gls file for error messages for LIN_GEIG_GEN. These error messages are numbered 921–936; 941–956; 961–976; 981–996.
Examples
Example 1: Computing Generalized Eigenvalues
The generalized eigenvalues of a random real matrix pencil are computed. These values are checked by obtaining the generalized eigenvectors and then showing that the residuals
AV-BVαβ-1
are small. Note that when the matrix B is nonsingular β = I, the identity matrix. When B is singular and A is nonsingular, some diagonal entries of β are essentially zero. This corresponds to “infinite eigenvalues” of the matrix pencil. This random matrix pencil example has all finite eigenvalues. Also, see operator_ex33, Chapter 10.
write (*,*) 'Example 1 for LIN_GEIG_GEN is correct.'
end if
end
Output
Example 1 for LIN_GEIG_GEN is correct.
Example 2: Self-Adjoint, Positive-Definite Generalized Eigenvalue Problem
This example illustrates the use of optional flags for the special case where A and B are complex self-adjoint matrices, and B is positive-definite. For purposes of maximum efficiency an option is passed to routine LIN_SOL_SELF so that pivoting is not used in the computation of the Cholesky decomposition of matrix B. This example does not require that secondary option. Also, see operator_ex34, supplied with the product examples.
write (*,*) 'Example 2 for LIN_GEIG_GEN is correct.'
end if
end
Output
Example 2 for LIN_GEIG_GEN is correct.
Example 3: A Test for a Regular Matrix Pencil
In the classification of Differential Algebraic Equations (DAE), a system with linear constant coefficients is given by A + Bx = f. Here A and B are n × n matrices, and f is an n-vector that is not part of this example. The DAE system is defined as solvable if and only if the quantity det (μA + B) does not vanish identically as a function of the dummy parameter μ. A sufficient condition for solvability is that the generalized eigenvalue problem Av = λBv is nonsingular. By constructing A and B so that both are singular, the routine flags nonsolvability in the DAE by returning NaN for the generalized eigenvalues. Also, see operator_ex35, supplied with the product examples.
! (The size of epack() is too small for the message, so
! output is blocked with NaNs.)
if (isnan(alpha)) then
write (*,*) 'Example 3 for LIN_GEIG_GEN is correct.'
end if
end
Output
Example 3 for LIN_GEIG_GEN is correct.
Example 4: Larger Data Uncertainty than Working Precision
Data values in both matrices A and B are assumed to have relative errors that can be as large as Ɛ 1/2 where Ɛ is the relative machine precision. This example illustrates the use of an optional flag that resets the tolerance used in routine lin_sol_lsq for determining a singularity of either matrix. The tolerance is reset to the new value Ɛ1/2∥B∥ and the generalized eigenvalue problem is solved. We anticipate that B might be singular and detect this fact. Also, see ---operator_ex36, Chapter 10.