    

 ## On this page

  

 

 # MatrixEigenSym Class Reference

 Last update: 16.07.2025 

Eigen decomposition of symmetric matrices. [More...](class_matrix_eigen_sym.xhtml#details)

## <a name="pub-types"></a>Public Types

<a id="a973c5b26a9107f3517a08587cff16bd2"></a>typedef Eigen::Matrix&lt; [TScalar](class_matrix_eigen_sym.xhtml#ad33f729eda6e45412aac71cee702012f), Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor &gt; [Base](class_matrix_eigen_sym.xhtml#a973c5b26a9107f3517a08587cff16bd2) the Eigen matrix type we refer to   
 <a id="a7a0768641f04f51b58ea111f6f428b00"></a>typedef Eigen::Matrix&lt; [TScalar](class_matrix_eigen_sym.xhtml#ad33f729eda6e45412aac71cee702012f), Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor &gt; [Base2](class_matrix_eigen_sym.xhtml#a7a0768641f04f51b58ea111f6f428b00) the Eigen matrix type which is used by the Eigen solvers   
 <a id="a31525d7455891e23040ebb9f024548be"></a>typedef int [TIndex](class_matrix_eigen_sym.xhtml#a31525d7455891e23040ebb9f024548be) index type of Eigen matrices   
 <a id="ad33f729eda6e45412aac71cee702012f"></a>typedef number [TScalar](class_matrix_eigen_sym.xhtml#ad33f729eda6e45412aac71cee702012f) the scalar tyta type of matrix elements   
 <a id="a05acf22c9e13df2dd8a0889f3a82984a"></a>typedef Eigen::SelfAdjointEigenSolver&lt; [Base2](class_matrix_eigen_sym.xhtml#a7a0768641f04f51b58ea111f6f428b00) &gt; [TSolver](class_matrix_eigen_sym.xhtml#a05acf22c9e13df2dd8a0889f3a82984a) the solver type for standard eigenvalue problem   
 <a id="acf57bed8d1be5d670c004a0b9561a689"></a>typedef Eigen::GeneralizedSelfAdjointEigenSolver&lt; [Base2](class_matrix_eigen_sym.xhtml#a7a0768641f04f51b58ea111f6f428b00) &gt; [TSolverGeneralized](class_matrix_eigen_sym.xhtml#acf57bed8d1be5d670c004a0b9561a689) the solver type for generalized eigenvalue problem   
 ## <a name="pub-methods"></a>Public Member Functions

[Matrix](class_matrix.xhtml) [\_\_pow\_\_](class_matrix_eigen_sym.xhtml#ac1a7734bfd755f5b20891adbda2e5ae3) ([TScalar](class_matrix_eigen_sym.xhtml#ad33f729eda6e45412aac71cee702012f) exponent) const operator ^(scalar) in scripting languages by SWIG [More...](#ac1a7734bfd755f5b20891adbda2e5ae3)  
 [Matrix](class_matrix.xhtml) [Eigenvalues](class_matrix_eigen_sym.xhtml#a2559d3424ae4c46803b8d9cfd34248b3) () const [Matrix](class_matrix.xhtml) [Eigenvectors](class_matrix_eigen_sym.xhtml#a77aadddc0daef135a3e8ee7bdc5e077b) () const bool [EigenvectorsAvailable](class_matrix_eigen_sym.xhtml#abe0ed699d6b4ae6111af006ad979112c) () const [Matrix](class_matrix.xhtml) [Exp](class_matrix_eigen_sym.xhtml#a87f6fab7e3fe95960eaeb1b498c93e07) () bool [IsGeneralEigenproblem](class_matrix_eigen_sym.xhtml#a390d11bc9bb6b0a596e78b2fd79a9f04) () const [Matrix](class_matrix.xhtml) [Log](class_matrix_eigen_sym.xhtml#a51da26cb713f8a3acf7856fba158ed60) ()  [MatrixEigenSym](class_matrix_eigen_sym.xhtml#aabca9a521f03b111946075607efd5abf) ([Matrix](class_matrix.xhtml) \_object, bool computevectors=true) destructor [More...](#aabca9a521f03b111946075607efd5abf)  
  [MatrixEigenSym](class_matrix_eigen_sym.xhtml#a3ccaac89fc3bd7623579777afba85371) ([Matrix](class_matrix.xhtml) \_object, [Matrix](class_matrix.xhtml) mass, bool computevectors=true) constructor of a generalized eigenvalue problem [More...](#a3ccaac89fc3bd7623579777afba85371)  
 [Matrix](class_matrix.xhtml) [OperatorInverseSqrt](class_matrix_eigen_sym.xhtml#a635c08172a091d0965aaa27c94c13800) () const [Matrix](class_matrix.xhtml) [OperatorSqrt](class_matrix_eigen_sym.xhtml#ad4dd9c8bbfecd5a7634ef3c542e05cbf) () const [Matrix](class_matrix.xhtml) [Pow](class_matrix_eigen_sym.xhtml#af79633a1270172c5f549fa393c4e7856) ([TScalar](class_matrix_eigen_sym.xhtml#ad33f729eda6e45412aac71cee702012f) exponent) <a id="details" name="details"></a>## Detailed Description

Eigen decomposition of symmetric matrices.

This class provides an Eigen decomposition of symmetric matrices. At construction, it factorizes the given matrix and stores eigenvalues and (if asked for) eigenvectors. The constructor accepts either the standard eigenvalues problem (of a single symmetric matrix) or the generalized eigenvalue problem (of 2 symmetric matrices).

The class is equipped with methods and arithmetic operators which provide the

- matrix exponential
- matrix power
- matrix logarithm
- matrix square root using the full decomposition.



## Constructor &amp; Destructor Documentation

<a id="aabca9a521f03b111946075607efd5abf"></a>## [◆ ](#aabca9a521f03b111946075607efd5abf)MatrixEigenSym() \[1/2\]

 [MatrixEigenSym](class_matrix_eigen_sym.xhtml)  ( [Matrix](class_matrix.xhtml)  *\_object*,    bool  *computevectors* = `true`   ) 

destructor

constructor of a standard eigenvalue problem

Parameters \_objectthe matrix to be decomposed computevectorsif true, then also the eigenvectors are computed. else only eigenvalues 



<a id="a3ccaac89fc3bd7623579777afba85371"></a>## [◆ ](#a3ccaac89fc3bd7623579777afba85371)MatrixEigenSym() \[2/2\]

 [MatrixEigenSym](class_matrix_eigen_sym.xhtml)  ( [Matrix](class_matrix.xhtml)  *\_object*,    [Matrix](class_matrix.xhtml)  *mass*,    bool  *computevectors* = `true`   ) 

constructor of a generalized eigenvalue problem

Parameters \_objectthe matrix to be decomposed, eg. the stiffness matrix massthe second matrix, eg. the mass matrix computevectorsif true, then also the eigenvectors are computed. else only eigenvalues 



## Member Function Documentation

<a id="ac1a7734bfd755f5b20891adbda2e5ae3"></a>## [◆ ](#ac1a7734bfd755f5b20891adbda2e5ae3)\_\_pow\_\_()

 [Matrix](class_matrix.xhtml) \_\_pow\_\_  ( [TScalar](class_matrix_eigen_sym.xhtml#ad33f729eda6e45412aac71cee702012f)  *exponent*)  const

operator ^(scalar) in scripting languages by SWIG

Returnsthe power of the matrix, i.e. $ A^n$ $ Parameters exponentthe exponent $ n $ 



<a id="a2559d3424ae4c46803b8d9cfd34248b3"></a>## [◆ ](#a2559d3424ae4c46803b8d9cfd34248b3)Eigenvalues()

 [Matrix](class_matrix.xhtml) Eigenvalues  ( )  const

Returnsthe eigenvalues as vector 



<a id="a77aadddc0daef135a3e8ee7bdc5e077b"></a>## [◆ ](#a77aadddc0daef135a3e8ee7bdc5e077b)Eigenvectors()

 [Matrix](class_matrix.xhtml) Eigenvectors  ( )  const

Returnsthe normalized complex eigenvectors as a matrix of column vectors. 



<a id="abe0ed699d6b4ae6111af006ad979112c"></a>## [◆ ](#abe0ed699d6b4ae6111af006ad979112c)EigenvectorsAvailable()

 bool EigenvectorsAvailable  ( )  const

Returnsm\_eigenvectorsAvailable 



<a id="a87f6fab7e3fe95960eaeb1b498c93e07"></a>## [◆ ](#a87f6fab7e3fe95960eaeb1b498c93e07)Exp()

 [Matrix](class_matrix.xhtml) Exp  ( ) 

Returnsthe exponential of the matrix 



<a id="a390d11bc9bb6b0a596e78b2fd79a9f04"></a>## [◆ ](#a390d11bc9bb6b0a596e78b2fd79a9f04)IsGeneralEigenproblem()

 bool IsGeneralEigenproblem  ( )  const

Returnsm\_isGeneralEigenproblem 



<a id="a51da26cb713f8a3acf7856fba158ed60"></a>## [◆ ](#a51da26cb713f8a3acf7856fba158ed60)Log()

 [Matrix](class_matrix.xhtml) Log  ( ) 

Returnsthe logarithm of the matrix 



<a id="a635c08172a091d0965aaa27c94c13800"></a>## [◆ ](#a635c08172a091d0965aaa27c94c13800)OperatorInverseSqrt()

 [Matrix](class_matrix.xhtml) OperatorInverseSqrt  ( )  const

Returnsthe positive inverse square root of the matrix (if positive definite) 



<a id="ad4dd9c8bbfecd5a7634ef3c542e05cbf"></a>## [◆ ](#ad4dd9c8bbfecd5a7634ef3c542e05cbf)OperatorSqrt()

 [Matrix](class_matrix.xhtml) OperatorSqrt  ( )  const

Returnsthe positive square root of the matrix (if positive definite) 



<a id="af79633a1270172c5f549fa393c4e7856"></a>## [◆ ](#af79633a1270172c5f549fa393c4e7856)Pow()

 [Matrix](class_matrix.xhtml) Pow  ( [TScalar](class_matrix_eigen_sym.xhtml#ad33f729eda6e45412aac71cee702012f)  *exponent*) 

Returnsthe power of the matrix, i.e. $ A^n$ $ Parameters exponentthe exponent $ n $