![]() |
|
Tridiagonal decomposition of a selfadjoint matrix. More...
#include <Tridiagonalization.h>
Public Types | |
| enum | { Size = MatrixType::RowsAtCompileTime , SizeMinusOne = Size == Dynamic ? Dynamic : (Size > 1 ? Size - 1 : 1) , Options = internal::traits<MatrixType>::Options , MaxSize = MatrixType::MaxRowsAtCompileTime , MaxSizeMinusOne = MaxSize == Dynamic ? Dynamic : (MaxSize > 1 ? MaxSize - 1 : 1) } |
| typedef MatrixType_ | MatrixType |
Synonym for the template parameter MatrixType_. More... | |
| typedef MatrixType::Scalar | Scalar |
| typedef NumTraits< Scalar >::Real | RealScalar |
| typedef Eigen::Index | Index |
| typedef Matrix< Scalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > | CoeffVectorType |
| typedef internal::plain_col_type< MatrixType, RealScalar >::type | DiagonalType |
| typedef Matrix< RealScalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > | SubDiagonalType |
| typedef internal::remove_all_t< typename MatrixType::RealReturnType > | MatrixTypeRealView |
| typedef internal::TridiagonalizationMatrixTReturnType< MatrixTypeRealView > | MatrixTReturnType |
| typedef std::conditional_t< NumTraits< Scalar >::IsComplex, internal::add_const_on_value_type_t< typename Diagonal< const MatrixType >::RealReturnType >, const Diagonal< const MatrixType > > | DiagonalReturnType |
| typedef std::conditional_t< NumTraits< Scalar >::IsComplex, internal::add_const_on_value_type_t< typename Diagonal< const MatrixType, -1 >::RealReturnType >, const Diagonal< const MatrixType, -1 > > | SubDiagonalReturnType |
| typedef HouseholderSequence< MatrixType, internal::remove_all_t< typename CoeffVectorType::ConjugateReturnType > > | HouseholderSequenceType |
| Return type of matrixQ() More... | |
Public Member Functions | |
| Tridiagonalization (Index size=Size==Dynamic ? 2 :Size) | |
| Default constructor. More... | |
| template<typename InputType > | |
| Tridiagonalization (const EigenBase< InputType > &matrix) | |
| Constructor; computes tridiagonal decomposition of given matrix. More... | |
| template<typename InputType > | |
| Tridiagonalization & | compute (const EigenBase< InputType > &matrix) |
| Computes tridiagonal decomposition of given matrix. More... | |
| CoeffVectorType | householderCoefficients () const |
| Returns the Householder coefficients. More... | |
| const MatrixType & | packedMatrix () const |
| Returns the internal representation of the decomposition. More... | |
| HouseholderSequenceType | matrixQ () const |
| Returns the unitary matrix Q in the decomposition. More... | |
| MatrixTReturnType | matrixT () const |
| Returns an expression of the tridiagonal matrix T in the decomposition. More... | |
| DiagonalReturnType | diagonal () const |
| Returns the diagonal of the tridiagonal matrix T in the decomposition. More... | |
| SubDiagonalReturnType | subDiagonal () const |
| Returns the subdiagonal of the tridiagonal matrix T in the decomposition. More... | |
Protected Attributes | |
| MatrixType | m_matrix |
| CoeffVectorType | m_hCoeffs |
| bool | m_isInitialized |
Tridiagonal decomposition of a selfadjoint matrix.
\eigenvalues_module
| MatrixType_ | the type of the matrix of which we are computing the tridiagonal decomposition; this is expected to be an instantiation of the Matrix class template. |
This class performs a tridiagonal decomposition of a selfadjoint matrix \( A \) such that: \( A = Q T Q^* \) where \( Q \) is unitary and \( T \) a real symmetric tridiagonal matrix.
A tridiagonal matrix is a matrix which has nonzero elements only on the main diagonal and the first diagonal below and above it. The Hessenberg decomposition of a selfadjoint matrix is in fact a tridiagonal decomposition. This class is used in SelfAdjointEigenSolver to compute the eigenvalues and eigenvectors of a selfadjoint matrix.
Call the function compute() to compute the tridiagonal decomposition of a given matrix. Alternatively, you can use the Tridiagonalization(const MatrixType&) constructor which computes the tridiagonal Schur decomposition at construction time. Once the decomposition is computed, you can use the matrixQ() and matrixT() functions to retrieve the matrices Q and T in the decomposition.
The documentation of Tridiagonalization(const MatrixType&) contains an example of the typical use of this class.
| typedef Matrix<Scalar, SizeMinusOne, 1, Options & ~RowMajor, MaxSizeMinusOne, 1> Eigen::Tridiagonalization< MatrixType_ >::CoeffVectorType |
| typedef std::conditional_t<NumTraits<Scalar>::IsComplex, internal::add_const_on_value_type_t<typename Diagonal<const MatrixType>::RealReturnType>, const Diagonal<const MatrixType> > Eigen::Tridiagonalization< MatrixType_ >::DiagonalReturnType |
| typedef internal::plain_col_type<MatrixType, RealScalar>::type Eigen::Tridiagonalization< MatrixType_ >::DiagonalType |
| typedef HouseholderSequence<MatrixType, internal::remove_all_t<typename CoeffVectorType::ConjugateReturnType> > Eigen::Tridiagonalization< MatrixType_ >::HouseholderSequenceType |
Return type of matrixQ()
| typedef Eigen::Index Eigen::Tridiagonalization< MatrixType_ >::Index |
| typedef internal::TridiagonalizationMatrixTReturnType<MatrixTypeRealView> Eigen::Tridiagonalization< MatrixType_ >::MatrixTReturnType |
| typedef MatrixType_ Eigen::Tridiagonalization< MatrixType_ >::MatrixType |
Synonym for the template parameter MatrixType_.
| typedef internal::remove_all_t<typename MatrixType::RealReturnType> Eigen::Tridiagonalization< MatrixType_ >::MatrixTypeRealView |
| typedef NumTraits<Scalar>::Real Eigen::Tridiagonalization< MatrixType_ >::RealScalar |
| typedef MatrixType::Scalar Eigen::Tridiagonalization< MatrixType_ >::Scalar |
| typedef std::conditional_t< NumTraits<Scalar>::IsComplex, internal::add_const_on_value_type_t<typename Diagonal<const MatrixType, -1>::RealReturnType>, const Diagonal<const MatrixType, -1> > Eigen::Tridiagonalization< MatrixType_ >::SubDiagonalReturnType |
| typedef Matrix<RealScalar, SizeMinusOne, 1, Options & ~RowMajor, MaxSizeMinusOne, 1> Eigen::Tridiagonalization< MatrixType_ >::SubDiagonalType |
| anonymous enum |
|
inlineexplicit |
Default constructor.
| [in] | size | Positive integer, size of the matrix whose tridiagonal decomposition will be computed. |
The default constructor is useful in cases in which the user intends to perform decompositions via compute(). The size parameter is only used as a hint. It is not an error to give a wrong size, but it may impair performance.
|
inlineexplicit |
Constructor; computes tridiagonal decomposition of given matrix.
| [in] | matrix | Selfadjoint matrix whose tridiagonal decomposition is to be computed. |
This constructor calls compute() to compute the tridiagonal decomposition.
Example:
Output:
References Eigen::Tridiagonalization< MatrixType_ >::m_hCoeffs, Eigen::Tridiagonalization< MatrixType_ >::m_isInitialized, Eigen::Tridiagonalization< MatrixType_ >::m_matrix, and Eigen::internal::tridiagonalization_inplace().
|
inline |
Computes tridiagonal decomposition of given matrix.
| [in] | matrix | Selfadjoint matrix whose tridiagonal decomposition is to be computed. |
*this The tridiagonal decomposition is computed by bringing the columns of the matrix successively in the required form using Householder reflections. The cost is \( 4n^3/3 \) flops, where \( n \) denotes the size of the given matrix.
This method reuses of the allocated data in the Tridiagonalization object, if the size of the matrix does not change.
Example:
Output:
References Eigen::Tridiagonalization< MatrixType_ >::m_hCoeffs, Eigen::Tridiagonalization< MatrixType_ >::m_isInitialized, Eigen::Tridiagonalization< MatrixType_ >::m_matrix, matrix(), Eigen::PlainObjectBase< Derived >::resize(), and Eigen::internal::tridiagonalization_inplace().
Referenced by ctms_decompositions().
| Tridiagonalization< MatrixType >::DiagonalReturnType Eigen::Tridiagonalization< MatrixType >::diagonal |
Returns the diagonal of the tridiagonal matrix T in the decomposition.
Example:
Output:
References eigen_assert.
Referenced by selfadjointeigensolver().
|
inline |
Returns the Householder coefficients.
The Householder coefficients allow the reconstruction of the matrix \( Q \) in the tridiagonal decomposition from the packed data.
Example:
Output:
References eigen_assert, Eigen::Tridiagonalization< MatrixType_ >::m_hCoeffs, and Eigen::Tridiagonalization< MatrixType_ >::m_isInitialized.
|
inline |
Returns the unitary matrix Q in the decomposition.
This function returns a light-weight object of template class HouseholderSequence. You can either apply it directly to a matrix or you can convert it to a matrix of type MatrixType.
References eigen_assert, Eigen::Tridiagonalization< MatrixType_ >::m_hCoeffs, Eigen::Tridiagonalization< MatrixType_ >::m_isInitialized, and Eigen::Tridiagonalization< MatrixType_ >::m_matrix.
Referenced by selfadjointeigensolver().
|
inline |
Returns an expression of the tridiagonal matrix T in the decomposition.
Currently, this function can be used to extract the matrix T from internal data and copy it to a dense matrix object. In most cases, it may be sufficient to directly use the packed matrix or the vector expressions returned by diagonal() and subDiagonal() instead of creating a new dense copy matrix with this function.
References eigen_assert, Eigen::Tridiagonalization< MatrixType_ >::m_isInitialized, and Eigen::Tridiagonalization< MatrixType_ >::m_matrix.
Referenced by selfadjointeigensolver().
|
inline |
Returns the internal representation of the decomposition.
The returned matrix contains the following information:
See LAPACK for further details on this packed storage.
Example:
Output:
References eigen_assert, Eigen::Tridiagonalization< MatrixType_ >::m_isInitialized, and Eigen::Tridiagonalization< MatrixType_ >::m_matrix.
| Tridiagonalization< MatrixType >::SubDiagonalReturnType Eigen::Tridiagonalization< MatrixType >::subDiagonal |
Returns the subdiagonal of the tridiagonal matrix T in the decomposition.
References diagonal(), eigen_assert, and Eigen::real().
Referenced by selfadjointeigensolver().
|
protected |
|
protected |
Referenced by Eigen::Tridiagonalization< MatrixType_ >::compute(), Eigen::Tridiagonalization< MatrixType_ >::householderCoefficients(), Eigen::Tridiagonalization< MatrixType_ >::matrixQ(), Eigen::Tridiagonalization< MatrixType_ >::matrixT(), Eigen::Tridiagonalization< MatrixType_ >::packedMatrix(), and Eigen::Tridiagonalization< MatrixType_ >::Tridiagonalization().
|
protected |