Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Private Types

GeneralizedSelfAdjointEigenSolver< _MatrixType > Class Template Reference


Detailed Description

template<typename _MatrixType>
class GeneralizedSelfAdjointEigenSolver< _MatrixType >

Computes eigenvalues and eigenvectors of the generalized selfadjoint eigen problem

Template Parameters:
_MatrixTypethe type of the matrix of which we are computing the eigendecomposition; this is expected to be an instantiation of the Matrix class template.

This class solves the generalized eigenvalue problem $ Av = \lambda Bv $. In this case, the matrix $ A $ should be selfadjoint and the matrix $ B $ should be positive definite.

Only the lower triangular part of the input matrix is referenced.

Call the function compute() to compute the eigenvalues and eigenvectors of a given matrix. Alternatively, you can use the GeneralizedSelfAdjointEigenSolver(const MatrixType&, const MatrixType&, int) constructor which computes the eigenvalues and eigenvectors at construction time. Once the eigenvalue and eigenvectors are computed, they can be retrieved with the eigenvalues() and eigenvectors() functions.

The documentation for GeneralizedSelfAdjointEigenSolver(const MatrixType&, const MatrixType&, int) contains an example of the typical use of this class.

See also:
class SelfAdjointEigenSolver, class EigenSolver, class ComplexEigenSolver

Definition at line 62 of file GeneralizedSelfAdjointEigenSolver.h.

#include <src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h>

Inheritance diagram for GeneralizedSelfAdjointEigenSolver< _MatrixType >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Base::Index Index
typedef _MatrixType MatrixType

Public Member Functions

 GeneralizedSelfAdjointEigenSolver ()
 Default constructor for fixed-size matrices.
 GeneralizedSelfAdjointEigenSolver (Index size)
 Constructor, pre-allocates memory for dynamic-size matrices.
 GeneralizedSelfAdjointEigenSolver (const MatrixType &matA, const MatrixType &matB, int options=ComputeEigenvectors|Ax_lBx)
 Constructor; computes generalized eigendecomposition of given matrix pencil.
GeneralizedSelfAdjointEigenSolvercompute (const MatrixType &matA, const MatrixType &matB, int options=ComputeEigenvectors|Ax_lBx)
 Computes generalized eigendecomposition of given matrix pencil.

Private Types

typedef SelfAdjointEigenSolver
< _MatrixType > 
Base

Member Typedef Documentation

template<typename _MatrixType >
typedef SelfAdjointEigenSolver<_MatrixType> GeneralizedSelfAdjointEigenSolver< _MatrixType >::Base [private]

Definition at line 64 of file GeneralizedSelfAdjointEigenSolver.h.

template<typename _MatrixType >
typedef Base::Index GeneralizedSelfAdjointEigenSolver< _MatrixType >::Index

Reimplemented from SelfAdjointEigenSolver< _MatrixType >.

Definition at line 67 of file GeneralizedSelfAdjointEigenSolver.h.

template<typename _MatrixType >
typedef _MatrixType GeneralizedSelfAdjointEigenSolver< _MatrixType >::MatrixType

Reimplemented from SelfAdjointEigenSolver< _MatrixType >.

Definition at line 68 of file GeneralizedSelfAdjointEigenSolver.h.


Constructor & Destructor Documentation

template<typename _MatrixType >
GeneralizedSelfAdjointEigenSolver< _MatrixType >::GeneralizedSelfAdjointEigenSolver ( ) [inline]

Default constructor for fixed-size matrices.

The default constructor is useful in cases in which the user intends to perform decompositions via compute(const MatrixType&, bool) or compute(const MatrixType&, const MatrixType&, bool). This constructor can only be used if _MatrixType is a fixed-size matrix; use SelfAdjointEigenSolver(Index) for dynamic-size matrices.

Example:

Output:

Definition at line 81 of file GeneralizedSelfAdjointEigenSolver.h.

template<typename _MatrixType >
GeneralizedSelfAdjointEigenSolver< _MatrixType >::GeneralizedSelfAdjointEigenSolver ( Index  size) [inline]

Constructor, pre-allocates memory for dynamic-size matrices.

Parameters:
[in]sizePositive integer, size of the matrix whose eigenvalues and eigenvectors will be computed.

This constructor is useful for dynamic-size matrices, when the user intends to perform decompositions via compute(const MatrixType&, bool) or compute(const MatrixType&, const MatrixType&, bool). The size parameter is only used as a hint. It is not an error to give a wrong size, but it may impair performance.

See also:
compute(const MatrixType&, bool) for an example

Definition at line 96 of file GeneralizedSelfAdjointEigenSolver.h.

template<typename _MatrixType >
GeneralizedSelfAdjointEigenSolver< _MatrixType >::GeneralizedSelfAdjointEigenSolver ( const MatrixType matA,
const MatrixType matB,
int  options = ComputeEigenvectors|Ax_lBx 
) [inline]

Constructor; computes generalized eigendecomposition of given matrix pencil.

Parameters:
[in]matASelfadjoint matrix in matrix pencil. Only the lower triangular part of the matrix is referenced.
[in]matBPositive-definite matrix in matrix pencil. Only the lower triangular part of the matrix is referenced.
[in]optionsA or-ed set of flags {ComputeEigenvectors,EigenvaluesOnly} | {Ax_lBx,ABx_lx,BAx_lx}. Default is ComputeEigenvectors|Ax_lBx.

This constructor calls compute(const MatrixType&, const MatrixType&, int) to compute the eigenvalues and (if requested) the eigenvectors of the generalized eigenproblem $ Ax = \lambda B x $ with matA the selfadjoint matrix $ A $ and matB the positive definite matrix $ B $. Each eigenvector $ x $ satisfies the property $ x^* B x = 1 $. The eigenvectors are computed if options contains ComputeEigenvectors.

In addition, the two following variants can be solved via options:

  • ABx_lx: $ ABx = \lambda x $
  • BAx_lx: $ BAx = \lambda x $

Example:

Output:

See also:
compute(const MatrixType&, const MatrixType&, int)

Definition at line 126 of file GeneralizedSelfAdjointEigenSolver.h.

References GeneralizedSelfAdjointEigenSolver< _MatrixType >::compute().


Member Function Documentation

template<typename MatrixType >
GeneralizedSelfAdjointEigenSolver< MatrixType > & GeneralizedSelfAdjointEigenSolver< MatrixType >::compute ( const MatrixType matA,
const MatrixType matB,
int  options = ComputeEigenvectors|Ax_lBx 
)

Computes generalized eigendecomposition of given matrix pencil.

Parameters:
[in]matASelfadjoint matrix in matrix pencil. Only the lower triangular part of the matrix is referenced.
[in]matBPositive-definite matrix in matrix pencil. Only the lower triangular part of the matrix is referenced.
[in]optionsA or-ed set of flags {ComputeEigenvectors,EigenvaluesOnly} | {Ax_lBx,ABx_lx,BAx_lx}. Default is ComputeEigenvectors|Ax_lBx.
Returns:
Reference to *this

Accoring to options, this function computes eigenvalues and (if requested) the eigenvectors of one of the following three generalized eigenproblems:

  • Ax_lBx: $ Ax = \lambda B x $
  • ABx_lx: $ ABx = \lambda x $
  • BAx_lx: $ BAx = \lambda x $ with matA the selfadjoint matrix $ A $ and matB the positive definite matrix $ B $. In addition, each eigenvector $ x $ satisfies the property $ x^* B x = 1 $.

The eigenvalues() function can be used to retrieve the eigenvalues. If options contains ComputeEigenvectors, then the eigenvectors are also computed and can be retrieved by calling eigenvectors().

The implementation uses LLT to compute the Cholesky decomposition $ B = LL^* $ and computes the classical eigendecomposition of the selfadjoint matrix $ L^{-1} A (L^*)^{-1} $ if options contains Ax_lBx and of $ L^{*} A L $ otherwise. This solves the generalized eigenproblem, because any solution of the generalized eigenproblem $ Ax = \lambda B x $ corresponds to a solution $ L^{-1} A (L^*)^{-1} (L^* x) = \lambda (L^* x) $ of the eigenproblem for $ L^{-1} A (L^*)^{-1} $. Similar statements can be made for the two other variants.

Example:

Output:

See also:
GeneralizedSelfAdjointEigenSolver(const MatrixType&, const MatrixType&, int)

Definition at line 183 of file GeneralizedSelfAdjointEigenSolver.h.

References ABx_lx, Ax_lBx, BAx_lx, ComputeEigenvectors, eigen_assert, EigenvaluesOnly, EigVecMask, GenEigMask, LLT< _MatrixType, _UpLo >::matrixL(), and LLT< _MatrixType, _UpLo >::matrixU().

Referenced by GeneralizedSelfAdjointEigenSolver< _MatrixType >::GeneralizedSelfAdjointEigenSolver().




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011