Tapkee
ArpackGeneralizedSelfAdjointEigenSolver< LMatrixType, RMatrixType, MatrixOperation, BisSPD > Class Template Reference

#include <arpack_wrapper.hpp>

List of all members.

Public Types

typedef LMatrixType::Scalar Scalar
typedef LMatrixType::Index Index
typedef NumTraits< Scalar >::Real RealScalar
typedef
Eigen::internal::plain_col_type
< LMatrixType, RealScalar >
::type 
RealVectorType

Public Member Functions

 ArpackGeneralizedSelfAdjointEigenSolver ()
 ArpackGeneralizedSelfAdjointEigenSolver (const LMatrixType &A, const RMatrixType &B, Index nbrEigenvalues, std::string eigs_sigma="LM", int parameters=ComputeEigenvectors, RealScalar tol=0.0)
 ArpackGeneralizedSelfAdjointEigenSolver (const LMatrixType &A, Index nbrEigenvalues, std::string eigs_sigma="LM", int parameters=ComputeEigenvectors, RealScalar tol=0.0)
ArpackGeneralizedSelfAdjointEigenSolvercompute (const LMatrixType &A, const RMatrixType &B, Index nbrEigenvalues, std::string eigs_sigma="LM", int parameters=ComputeEigenvectors, RealScalar tol=0.0)
ArpackGeneralizedSelfAdjointEigenSolvercompute (const LMatrixType &A, Index nbrEigenvalues, std::string eigs_sigma="LM", int parameters=ComputeEigenvectors, RealScalar tol=0.0)
const Matrix< Scalar, Dynamic,
Dynamic > & 
eigenvectors () const
const Matrix< Scalar, Dynamic, 1 > & eigenvalues () const
Matrix< Scalar, Dynamic, Dynamic > operatorSqrt () const
Matrix< Scalar, Dynamic, Dynamic > operatorInverseSqrt () const
ComputationInfo info () const
size_t getNbrConvergedEigenValues () const
size_t getNbrIterations () const

Protected Attributes

Matrix< Scalar, Dynamic, Dynamic > m_eivec
Matrix< Scalar, Dynamic, 1 > m_eivalues
ComputationInfo m_info
bool m_isInitialized
bool m_eigenvectorsOk
size_t m_nbrConverged
size_t m_nbrIterations

Detailed Description

template<class LMatrixType, class RMatrixType, class MatrixOperation, bool BisSPD = false>
class ArpackGeneralizedSelfAdjointEigenSolver< LMatrixType, RMatrixType, MatrixOperation, BisSPD >

Definition at line 36 of file arpack_wrapper.hpp.


Member Typedef Documentation

typedef LMatrixType::Index Index

Definition at line 43 of file arpack_wrapper.hpp.

typedef NumTraits<Scalar>::Real RealScalar

Real scalar type for MatrixType.

This is just Scalar if Scalar is real (e.g., float or Scalar), and the type of the real part of Scalar if Scalar is complex.

Definition at line 51 of file arpack_wrapper.hpp.

typedef Eigen::internal::plain_col_type<LMatrixType, RealScalar>::type RealVectorType

Type for vector of eigenvalues as returned by eigenvalues().

This is a column vector with entries of type RealScalar. The length of the vector is the size of nbrEigenvalues.

Definition at line 58 of file arpack_wrapper.hpp.

typedef LMatrixType::Scalar Scalar

Scalar type for matrices of type MatrixType.

Definition at line 42 of file arpack_wrapper.hpp.


Constructor & Destructor Documentation

Default constructor.

The default constructor is for cases in which the user intends to perform decompositions via compute().

Definition at line 66 of file arpack_wrapper.hpp.

ArpackGeneralizedSelfAdjointEigenSolver ( const LMatrixType &  A,
const RMatrixType &  B,
Index  nbrEigenvalues,
std::string  eigs_sigma = "LM",
int  parameters = ComputeEigenvectors,
RealScalar  tol = 0.0 
)

Constructor; computes generalized eigenvalues of given matrix with respect to another matrix.

Parameters:
[in]ASelf-adjoint matrix whose eigenvalues / eigenvectors will computed. By default, the upper triangular part is used, but can be changed through the template parameter.
[in]BSelf-adjoint matrix for the generalized eigenvalue problem.
[in]nbrEigenvaluesThe number of eigenvalues / eigenvectors to compute. Must be less than the size of the input matrix, or an error is returned.
[in]eigs_sigmaString containing either "LM", "SM", "LA", or "SA", with respective meanings to find the largest magnitude , smallest magnitude, largest algebraic, or smallest algebraic eigenvalues. Alternatively, this value can contain floating point value in string form, in which case the eigenvalues closest to this value will be found.
[in]parametersCan be ComputeEigenvectors (default) or EigenvaluesOnly.
[in]tolWhat tolerance to find the eigenvalues to. Default is 0, which means machine precision.

This constructor calls compute(const MatrixType&, const MatrixType&, Index, string, int, RealScalar) to compute the eigenvalues of the matrix A with respect to B. The eigenvectors are computed if parameters equals ComputeEigenvectors.

Definition at line 93 of file arpack_wrapper.hpp.

ArpackGeneralizedSelfAdjointEigenSolver ( const LMatrixType &  A,
Index  nbrEigenvalues,
std::string  eigs_sigma = "LM",
int  parameters = ComputeEigenvectors,
RealScalar  tol = 0.0 
)

Constructor; computes eigenvalues of given matrix.

Parameters:
[in]ASelf-adjoint matrix whose eigenvalues / eigenvectors will computed. By default, the upper triangular part is used, but can be changed through the template parameter.
[in]nbrEigenvaluesThe number of eigenvalues / eigenvectors to compute. Must be less than the size of the input matrix, or an error is returned.
[in]eigs_sigmaString containing either "LM", "SM", "LA", or "SA", with respective meanings to find the largest magnitude , smallest magnitude, largest algebraic, or smallest algebraic eigenvalues. Alternatively, this value can contain floating point value in string form, in which case the eigenvalues closest to this value will be found.
[in]parametersCan be ComputeEigenvectors (default) or EigenvaluesOnly.
[in]tolWhat tolerance to find the eigenvalues to. Default is 0, which means machine precision.

This constructor calls compute(const MatrixType&, Index, string, int, RealScalar) to compute the eigenvalues of the matrix A. The eigenvectors are computed if parameters equals ComputeEigenvectors.

Definition at line 123 of file arpack_wrapper.hpp.


Member Function Documentation

ArpackGeneralizedSelfAdjointEigenSolver< LMatrixType, RMatrixType, MatrixOperation, BisSPD > & compute ( const LMatrixType &  A,
const RMatrixType &  B,
Index  nbrEigenvalues,
std::string  eigs_sigma = "LM",
int  parameters = ComputeEigenvectors,
RealScalar  tol = 0.0 
)

Computes generalized eigenvalues / eigenvectors of given matrix using the external ARPACK library.

Parameters:
[in]ASelfadjoint matrix whose eigendecomposition is to be computed.
[in]BSelfadjoint matrix for generalized eigenvalues.
[in]nbrEigenvaluesThe number of eigenvalues / eigenvectors to compute. Must be less than the size of the input matrix, or an error is returned.
[in]eigs_sigmaString containing either "LM", "SM", "LA", or "SA", with respective meanings to find the largest magnitude , smallest magnitude, largest algebraic, or smallest algebraic eigenvalues. Alternatively, this value can contain floating point value in string form, in which case the eigenvalues closest to this value will be found.
[in]parametersCan be ComputeEigenvectors (default) or EigenvaluesOnly.
[in]tolWhat tolerance to find the eigenvalues to. Default is 0, which means machine precision.
Returns:
Reference to *this

This function computes the generalized eigenvalues of A with respect to B using ARPACK. The eigenvalues() function can be used to retrieve them. If parameters equals ComputeEigenvectors, then the eigenvectors are also computed and can be retrieved by calling eigenvectors().

Definition at line 312 of file arpack_wrapper.hpp.

ArpackGeneralizedSelfAdjointEigenSolver< LMatrixType, RMatrixType, MatrixOperation, BisSPD > & compute ( const LMatrixType &  A,
Index  nbrEigenvalues,
std::string  eigs_sigma = "LM",
int  parameters = ComputeEigenvectors,
RealScalar  tol = 0.0 
)

Computes eigenvalues / eigenvectors of given matrix using the external ARPACK library.

Parameters:
[in]ASelfadjoint matrix whose eigendecomposition is to be computed.
[in]nbrEigenvaluesThe number of eigenvalues / eigenvectors to compute. Must be less than the size of the input matrix, or an error is returned.
[in]eigs_sigmaString containing either "LM", "SM", "LA", or "SA", with respective meanings to find the largest magnitude , smallest magnitude, largest algebraic, or smallest algebraic eigenvalues. Alternatively, this value can contain floating point value in string form, in which case the eigenvalues closest to this value will be found.
[in]parametersCan be ComputeEigenvectors (default) or EigenvaluesOnly.
[in]tolWhat tolerance to find the eigenvalues to. Default is 0, which means machine precision.
Returns:
Reference to *this

This function computes the eigenvalues of A using ARPACK. The eigenvalues() function can be used to retrieve them. If parameters equals ComputeEigenvectors, then the eigenvectors are also computed and can be retrieved by calling eigenvectors().

Definition at line 302 of file arpack_wrapper.hpp.

const Matrix<Scalar, Dynamic, 1>& eigenvalues ( ) const

Returns the eigenvalues of given matrix.

Returns:
A const reference to the column vector containing the eigenvalues.
Precondition:
The eigenvalues have been computed before.

The eigenvalues are repeated according to their algebraic multiplicity, so there are as many eigenvalues as rows in the matrix. The eigenvalues are sorted in increasing order.

See also:
eigenvectors(), MatrixBase::eigenvalues()

Definition at line 219 of file arpack_wrapper.hpp.

const Matrix<Scalar, Dynamic, Dynamic>& eigenvectors ( ) const

Returns the eigenvectors of given matrix.

Returns:
A const reference to the matrix whose columns are the eigenvectors.
Precondition:
The eigenvectors have been computed before.

Column $ k $ of the returned matrix is an eigenvector corresponding to eigenvalue number $ k $ as returned by eigenvalues(). The eigenvectors are normalized to have (Euclidean) norm equal to one. If this object was used to solve the eigenproblem for the selfadjoint matrix $ A $, then the matrix returned by this function is the matrix $ V $ in the eigendecomposition $ A V = D V $. For the generalized eigenproblem, the matrix returned is the solution of $A V = D B V $

See also:
eigenvalues()

Definition at line 200 of file arpack_wrapper.hpp.

size_t getNbrConvergedEigenValues ( ) const

Definition at line 277 of file arpack_wrapper.hpp.

size_t getNbrIterations ( ) const

Definition at line 282 of file arpack_wrapper.hpp.

ComputationInfo info ( ) const

Reports whether previous computation was successful.

Returns:
Success if computation was succesful, NoConvergence otherwise.

Definition at line 271 of file arpack_wrapper.hpp.

Matrix<Scalar, Dynamic, Dynamic> operatorInverseSqrt ( ) const

Computes the inverse square root of the matrix.

Returns:
the inverse positive-definite square root of the matrix
Precondition:
The eigenvalues and eigenvectors of a positive-definite matrix have been computed before.

This function uses the eigendecomposition $ A = V D V^{-1} $ to compute the inverse square root as $ V D^{-1/2} V^{-1} $. This is cheaper than first computing the square root with operatorSqrt() and then its inverse with MatrixBase::inverse().

See also:
operatorSqrt(), MatrixBase::inverse(),

Definition at line 260 of file arpack_wrapper.hpp.

Matrix<Scalar, Dynamic, Dynamic> operatorSqrt ( ) const

Computes the positive-definite square root of the matrix.

Returns:
the positive-definite square root of the matrix
Precondition:
The eigenvalues and eigenvectors of a positive-definite matrix have been computed before.

The square root of a positive-definite matrix $ A $ is the positive-definite matrix whose square equals $ A $. This function uses the eigendecomposition $ A = V D V^{-1} $ to compute the square root as $ A^{1/2} = V D^{1/2} V^{-1} $.

See also:
operatorInverseSqrt(),

Definition at line 239 of file arpack_wrapper.hpp.


Member Data Documentation

bool m_eigenvectorsOk [protected]

Definition at line 293 of file arpack_wrapper.hpp.

Matrix<Scalar, Dynamic, 1> m_eivalues [protected]

Definition at line 290 of file arpack_wrapper.hpp.

Matrix<Scalar, Dynamic, Dynamic> m_eivec [protected]

Definition at line 289 of file arpack_wrapper.hpp.

ComputationInfo m_info [protected]

Definition at line 291 of file arpack_wrapper.hpp.

bool m_isInitialized [protected]

Definition at line 292 of file arpack_wrapper.hpp.

size_t m_nbrConverged [protected]

Definition at line 295 of file arpack_wrapper.hpp.

size_t m_nbrIterations [protected]

Definition at line 296 of file arpack_wrapper.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines