Skip to content

generalized_eigenvalues_symmetric_matrixgeneralized_eigenvalues_symmetric_matrixGeneralizedEigenvaluesSymmetricMatrixGeneralizedEigenvaluesSymmetricMatrixgeneralized_eigenvalues_symmetric_matrixT_generalized_eigenvalues_symmetric_matrix๐Ÿ”—

Short description๐Ÿ”—

generalized_eigenvalues_symmetric_matrixgeneralized_eigenvalues_symmetric_matrixGeneralizedEigenvaluesSymmetricMatrixGeneralizedEigenvaluesSymmetricMatrixgeneralized_eigenvalues_symmetric_matrixT_generalized_eigenvalues_symmetric_matrix โ€” Compute the generalized eigenvalues and optionally generalized eigenvectors of symmetric input matrices.

Signature๐Ÿ”—

generalized_eigenvalues_symmetric_matrix( matrix MatrixAID, matrix MatrixBID, string ComputeEigenvectors, out matrix EigenvaluesID, out matrix EigenvectorsID )generalized_eigenvalues_symmetric_matrix( : : MatrixAID, MatrixBID, ComputeEigenvectors : EigenvaluesID, EigenvectorsID )void GeneralizedEigenvaluesSymmetricMatrix( const HTuple& MatrixAID, const HTuple& MatrixBID, const HTuple& ComputeEigenvectors, HTuple* EigenvaluesID, HTuple* EigenvectorsID )static void HOperatorSet.GeneralizedEigenvaluesSymmetricMatrix( HTuple matrixAID, HTuple matrixBID, HTuple computeEigenvectors, out HTuple eigenvaluesID, out HTuple eigenvectorsID )def generalized_eigenvalues_symmetric_matrix( matrix_aid: HHandle, matrix_bid: HHandle, compute_eigenvectors: str ) -> Tuple[HHandle, HHandle]

Herror T_generalized_eigenvalues_symmetric_matrix( const Htuple MatrixAID, const Htuple MatrixBID, const Htuple ComputeEigenvectors, Htuple* EigenvaluesID, Htuple* EigenvectorsID )

HMatrix HMatrix::GeneralizedEigenvaluesSymmetricMatrix( const HMatrix& MatrixBID, const HString& ComputeEigenvectors, HMatrix* EigenvectorsID ) const

HMatrix HMatrix::GeneralizedEigenvaluesSymmetricMatrix( const HMatrix& MatrixBID, const char* ComputeEigenvectors, HMatrix* EigenvectorsID ) const

HMatrix HMatrix::GeneralizedEigenvaluesSymmetricMatrix( const HMatrix& MatrixBID, const wchar_t* ComputeEigenvectors, HMatrix* EigenvectorsID ) const (Windows only)

HMatrix HMatrix.GeneralizedEigenvaluesSymmetricMatrix( HMatrix matrixBID, string computeEigenvectors, out HMatrix eigenvectorsID )

Description๐Ÿ”—

The operator generalized_eigenvalues_symmetric_matrixGeneralizedEigenvaluesSymmetricMatrix computes all generalized eigenvalues and, optionally, generalized eigenvectors of the symmetric matrix MatrixA and the symmetric positive definite matrix MatrixB. Both matrices must have identical dimensions. The matrices are defined by the matrix handles MatrixAIDmatrixAIDmatrix_aid and MatrixBIDmatrixBIDmatrix_bid. On output, a new matrix Eigenvalues with the generalized eigenvalues in ascending order and, optionally, a new matrix Eigenvectors with the generalized eigenvectors is created. Each \(j\)th column of the matrix Eigenvectors contains the related eigenvector to the \(j\)th eigenvalue. The operator returns the matrix handles EigenvaluesIDeigenvaluesIDeigenvalues_id and EigenvectorsIDeigenvectorsIDeigenvectors_id of the matrices Eigenvalues and Eigenvectors. Access to the elements of the matrices is possible, e.g., with the operator get_full_matrixGetFullMatrix or get_sub_matrixGetSubMatrix.

The computation of generalized eigenvectors can be selected via ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors = 'true'"true". 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 eigenvalue and \(x_{j}\) represents the corresponding eigenvector.

If ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors = 'false'"false", no generalized eigenvectors are computed. For this, the matrix handle EigenvectorsIDeigenvectorsIDeigenvectors_id is invalid.

Example:

ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors = 'true'"true"

\[\begin{eqnarray*} \texttt{MatrixA} = \left[ \begin{array}{rrr} 4.0 & -3.0 & 2.0 \\ -3.0 & 1.0 & 4.0 \\ 2.0 & 4.0 & 8.0 \end{array} \right] \qquad \texttt{MatrixB} = \left[ \begin{array}{rrr} 6.0 & 5.0 & 3.0 \\ 5.0 & 7.0 & 3.0 \\ 3.0 & 3.0 & 4.0 \end{array} \right] \end{eqnarray*}\]
\[\begin{eqnarray*} \to \qquad \texttt{Eigenvalues} = \left[ \begin{array}{r} -0.4463 \\ 1.8747 \\ 4.5472 \end{array} \right] \qquad \texttt{Eigenvectors} = \left[ \begin{array}{rrr} -0.1579 & 0.1851 & -0.6358 \\ -0.3377 & -0.2568 & 0.4311 \\ 0.2382 & 0.5065 & 0.3185 \end{array} \right] \end{eqnarray*}\]

Attention๐Ÿ”—

The upper triangular parts of the input matrices MatrixA and MatrixB must contain the relevant information of the matrices. The strictly lower triangular parts of the matrices are not referenced. If the referenced parts of the input matrices MatrixA or MatrixB are not of the specified type, an exception is raised.

Execution information๐Ÿ”—

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)(handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle of the symmetric input matrix A.

MatrixBIDmatrixBIDmatrix_bid (input_control) matrix โ†’ (handle)(handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle of the symmetric positive definite input matrix B.

ComputeEigenvectorscomputeEigenvectorscompute_eigenvectors (input_control) string โ†’ (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Computation of the eigenvectors.

Default: 'false'"false"
List of values: 'false', 'true'"false", "true"

EigenvaluesIDeigenvaluesIDeigenvalues_id (output_control) matrix โ†’ (handle)(handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle with the eigenvalues.

EigenvectorsIDeigenvectorsIDeigenvectors_id (output_control) matrix โ†’ (handle)(handle)HTuple (HHandle)HMatrix, HTuple (IntPtr)HHandleHtuple (handle)

Matrix handle with the eigenvectors.

Result๐Ÿ”—

If the parameters are valid, the operator generalized_eigenvalues_symmetric_matrixGeneralizedEigenvaluesSymmetricMatrix 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

Alternatives

generalized_eigenvalues_general_matrixGeneralizedEigenvaluesGeneralMatrix

See also

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