generalized_eigenvalues_general_matrixGeneralizedEigenvaluesGeneralMatrixGeneralizedEigenvaluesGeneralMatrixgeneralized_eigenvalues_general_matrixT_generalized_eigenvalues_general_matrix
Short description
generalized_eigenvalues_general_matrixGeneralizedEigenvaluesGeneralMatrixGeneralizedEigenvaluesGeneralMatrixgeneralized_eigenvalues_general_matrixT_generalized_eigenvalues_general_matrix โ Compute the generalized eigenvalues and optionally the generalized
eigenvectors of general matrices.
Signature
generalized_eigenvalues_general_matrix( matrix MatrixAID, matrix MatrixBID, string ComputeEigenvectors, out matrix EigenvaluesRealID, out matrix EigenvaluesImagID, out matrix EigenvectorsRealID, out matrix EigenvectorsImagID )void GeneralizedEigenvaluesGeneralMatrix( const HTuple& MatrixAID, const HTuple& MatrixBID, const HTuple& ComputeEigenvectors, HTuple* EigenvaluesRealID, HTuple* EigenvaluesImagID, HTuple* EigenvectorsRealID, HTuple* EigenvectorsImagID )static void HOperatorSet.GeneralizedEigenvaluesGeneralMatrix( HTuple matrixAID, HTuple matrixBID, HTuple computeEigenvectors, out HTuple eigenvaluesRealID, out HTuple eigenvaluesImagID, out HTuple eigenvectorsRealID, out HTuple eigenvectorsImagID )def generalized_eigenvalues_general_matrix( matrix_aid: HHandle, matrix_bid: HHandle, compute_eigenvectors: str ) -> Tuple[HHandle, HHandle, HHandle, HHandle]
Herror T_generalized_eigenvalues_general_matrix( const Htuple MatrixAID, const Htuple MatrixBID, const Htuple ComputeEigenvectors, Htuple* EigenvaluesRealID, Htuple* EigenvaluesImagID, Htuple* EigenvectorsRealID, Htuple* EigenvectorsImagID )
void HMatrix::GeneralizedEigenvaluesGeneralMatrix( const HMatrix& MatrixBID, const HString& ComputeEigenvectors, HMatrix* EigenvaluesRealID, HMatrix* EigenvaluesImagID, HMatrix* EigenvectorsRealID, HMatrix* EigenvectorsImagID ) const
void HMatrix::GeneralizedEigenvaluesGeneralMatrix( const HMatrix& MatrixBID, const char* ComputeEigenvectors, HMatrix* EigenvaluesRealID, HMatrix* EigenvaluesImagID, HMatrix* EigenvectorsRealID, HMatrix* EigenvectorsImagID ) const
void HMatrix::GeneralizedEigenvaluesGeneralMatrix( const HMatrix& MatrixBID, const wchar_t* ComputeEigenvectors, HMatrix* EigenvaluesRealID, HMatrix* EigenvaluesImagID, HMatrix* EigenvectorsRealID, HMatrix* EigenvectorsImagID ) const (Windows only)
void HMatrix.GeneralizedEigenvaluesGeneralMatrix( HMatrix matrixBID, string computeEigenvectors, out HMatrix eigenvaluesRealID, out HMatrix eigenvaluesImagID, out HMatrix eigenvectorsRealID, out HMatrix eigenvectorsImagID )
Description
The operator generalized_eigenvalues_general_matrixGeneralizedEigenvaluesGeneralMatrix
computes all generalized eigenvalues and, optionally, the left
or right generalized eigenvectors of the square, general matrices
MatrixA and MatrixB. Both matrices must have
identical dimensions. The matrices are defined by the matrix
handles MatrixAIDmatrixAIDmatrix_aid and MatrixBIDmatrixBIDmatrix_bid. The computed
eigenvectors have the norm 1.
The operator generates the new matrices EigenvaluesReal
and EigenvaluesImag with the real and the imaginary parts
of the computed eigenvalues. Each matrix has one column and \(n\)
rows, where \(n\) is the number of rows or columns of the input
matrices. In contrast to the operator
generalized_eigenvalues_symmetric_matrixGeneralizedEigenvaluesSymmetricMatrix, the order of the
generalized eigenvalues is not defined.
The operator returns the matrix handles
EigenvaluesRealIDeigenvaluesRealIDeigenvalues_real_id and EigenvaluesImagIDeigenvaluesImagIDeigenvalues_imag_id. If
desired, the real and imaginary parts of the respective
eigenvectors are stored in the new matrices
EigenvectorsReal and EigenvectorsImag. Here,
the \(j\)th column of the matrices of eigenvectors contains the
related eigenvector to the \(j\)th eigenvalue. For this, the
operator returns additionally the matrix handles
EigenvectorsRealIDeigenvectorsRealIDeigenvectors_real_id and EigenvectorsImagIDeigenvectorsImagIDeigenvectors_imag_id.
Access to the elements of the matrix is possible, e.g., with the
operator get_full_matrixGetFullMatrix or get_sub_matrixGetSubMatrix.
The computation type of eigenvectors can be selected via the
parameter ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors. If
ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors = 'none'"none", no eigenvectors
are computed and the operator is faster. For this, the matrix
handles EigenvectorsRealIDeigenvectorsRealIDeigenvectors_real_id and EigenvectorsImagIDeigenvectorsImagIDeigenvectors_imag_id
are invalid. If 'right'"right" is selected, the right generalized
eigenvalues are computed. The formula for the calculation of the
result is
\[\begin{eqnarray*}
\texttt{MatrixA} \quad \cdot \quad x_{j} \quad = \quad
\lambda_{j} \quad \cdot \quad \texttt{MatrixB} \quad \cdot
\quad x_{j},
\end{eqnarray*}\]
with \(\lambda_{j}\) representing the \(j\)th (complex) eigenvalue
and \(x_{j}\) represents the corresponding (complex) eigenvector.
If 'left'"left" is selected, the left generalized eigenvalues
are computed. The formula for the calculation of the result is
\[\begin{eqnarray*}
{x^H}_{j} \quad \texttt{MatrixA} \quad \cdot \quad =
\quad {x^H}_{j} \cdot \quad \lambda_{j} \quad \cdot \quad
\texttt{MatrixB},
\end{eqnarray*}\]
with \({x^H}_{j}\) represents the conjugate-transposed of \(x_{j}\).
Example:
ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors = 'right'"right"
\[\begin{eqnarray*}
\texttt{MatrixA} =
\left[ \begin{array}{rrr}
6.0 & 4.0 & -8.0 \\
5.0 & 7.0 & 3.0 \\
4.0 & -1.0 & 4.0
\end{array} \right]
\qquad
\texttt{MatrixB} =
\left[ \begin{array}{rrr}
3.0 & 1.0 & 2.0 \\
-5.0 & 7.0 & 2.0 \\
9.0 & 4.0 & 1.0
\end{array} \right]
\end{eqnarray*}\]
\[\begin{eqnarray*}
\to \qquad
\texttt{EigenvaluesReal} &=&
\left[ \begin{array}{r}
0.5363 \\
0.5363 \\
-6.1616
\end{array} \right]\\
\texttt{EigenvaluesImag} &=&
\left[ \begin{array}{r}
0.4208 \\
-0.4208 \\
0.0
\end{array} \right]\\
\texttt{EigenvectorsReal} &=&
\left[ \begin{array}{rrr}
0.3500 & 0.3500 & 0.0410 \\
-0.9565 & -0.9565 & 0.3267 \\
-0.2757 & -0.2757 & -1.0000
\end{array} \right]\\
\texttt{EigenvectorsImag} &=&
\left[ \begin{array}{rrr}
-0.4644 & 0.4644 \quad & \quad 0.0 \\
0.0435 & -0.0435 \quad & \quad 0.0 \\
-0.1869 & 0.1869 \quad & \quad 0.0
\end{array} \right]
\end{eqnarray*}\]
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Processed without parallelization.
Parameters
MatrixAIDmatrixAIDmatrix_aid (input_control) matrix โ (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle of the input matrix A.
MatrixBIDmatrixBIDmatrix_bid (input_control) matrix โ (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle of the input matrix B.
ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors (input_control) string โ (string)HTuple (HString)HTuple (string)strHtuple (char*)
Computation of the eigenvectors.
Default: 'none'"none"
List of values: 'left', 'none', 'right'"left", "none", "right"
EigenvaluesRealIDeigenvaluesRealIDeigenvalues_real_id (output_control) matrix โ (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle with the real parts of the
eigenvalues.
EigenvaluesImagIDeigenvaluesImagIDeigenvalues_imag_id (output_control) matrix โ (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle with the imaginary parts of the
eigenvalues.
EigenvectorsRealIDeigenvectorsRealIDeigenvectors_real_id (output_control) matrix โ (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle with the real parts of the
eigenvectors.
EigenvectorsImagIDeigenvectorsImagIDeigenvectors_imag_id (output_control) matrix โ (handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)
Matrix handle with the imaginary parts of the
eigenvectors.
Result
If the parameters are valid, the operator
generalized_eigenvalues_general_matrixGeneralizedEigenvaluesGeneralMatrix returns the value
2 (H_MSG_TRUE). If necessary, an exception is raised.
Combinations with other operators
Combinations
Possible predecessors
create_matrixCreateMatrix
Possible successors
get_full_matrixGetFullMatrix, get_value_matrixGetValueMatrix, get_diagonal_matrixGetDiagonalMatrix
See also
generalized_eigenvalues_symmetric_matrixGeneralizedEigenvaluesSymmetricMatrix, eigenvalues_symmetric_matrixEigenvaluesSymmetricMatrix, eigenvalues_general_matrixEigenvaluesGeneralMatrix
References
David Poole: โLinear Algebra: A Modern Introductionโ; Thomson;
Belmont; 2006.
Gene H. Golub, Charles F. van Loan: โMatrix Computationsโ; The
Johns Hopkins University Press; Baltimore and London; 1996.
Module
Foundation