WPILibC++ 2023.4.3-108-ge5452e3
|
\eigenvalues_module More...
Public Types | |
enum | { Size = MatrixType::RowsAtCompileTime , SizeMinusOne = Size == Dynamic ? Dynamic : Size - 1 , Options = MatrixType::Options , MaxSize = MatrixType::MaxRowsAtCompileTime , MaxSizeMinusOne = MaxSize == Dynamic ? Dynamic : MaxSize - 1 } |
typedef _MatrixType | MatrixType |
Synonym for the template parameter _MatrixType . More... | |
typedef MatrixType::Scalar | Scalar |
Scalar type for matrices of type MatrixType. More... | |
typedef Eigen::Index | Index |
typedef Matrix< Scalar, SizeMinusOne, 1, Options &~RowMajor, MaxSizeMinusOne, 1 > | CoeffVectorType |
Type for vector of Householder coefficients. More... | |
typedef HouseholderSequence< MatrixType, typename internal::remove_all< typename CoeffVectorType::ConjugateReturnType >::type > | HouseholderSequenceType |
Return type of matrixQ() More... | |
typedef internal::HessenbergDecompositionMatrixHReturnType< MatrixType > | MatrixHReturnType |
Public Member Functions | |
HessenbergDecomposition (Index size=Size==Dynamic ? 2 :Size) | |
Default constructor; the decomposition will be computed later. More... | |
template<typename InputType > | |
HessenbergDecomposition (const EigenBase< InputType > &matrix) | |
Constructor; computes Hessenberg decomposition of given matrix. More... | |
template<typename InputType > | |
HessenbergDecomposition & | compute (const EigenBase< InputType > &matrix) |
Computes Hessenberg decomposition of given matrix. More... | |
const CoeffVectorType & | householderCoefficients () const |
Returns the Householder coefficients. More... | |
const MatrixType & | packedMatrix () const |
Returns the internal representation of the decomposition. More... | |
HouseholderSequenceType | matrixQ () const |
Reconstructs the orthogonal matrix Q in the decomposition. More... | |
MatrixHReturnType | matrixH () const |
Constructs the Hessenberg matrix H in the decomposition. More... | |
Protected Attributes | |
MatrixType | m_matrix |
CoeffVectorType | m_hCoeffs |
VectorType | m_temp |
bool | m_isInitialized |
\eigenvalues_module
Reduces a square matrix to Hessenberg form by an orthogonal similarity transformation
_MatrixType | the type of the matrix of which we are computing the Hessenberg decomposition |
This class performs an Hessenberg decomposition of a matrix \( A \). In the real case, the Hessenberg decomposition consists of an orthogonal matrix \( Q \) and a Hessenberg matrix \( H \) such that \( A = Q H Q^T \). An orthogonal matrix is a matrix whose inverse equals its transpose ( \( Q^{-1} = Q^T \)). A Hessenberg matrix has zeros below the subdiagonal, so it is almost upper triangular. The Hessenberg decomposition of a complex matrix is \( A = Q H Q^* \) with \( Q \) unitary (that is, \( Q^{-1} = Q^* \)).
Call the function compute() to compute the Hessenberg decomposition of a given matrix. Alternatively, you can use the HessenbergDecomposition(const MatrixType&) constructor which computes the Hessenberg decomposition at construction time. Once the decomposition is computed, you can use the matrixH() and matrixQ() functions to construct the matrices H and Q in the decomposition.
The documentation for matrixH() contains an example of the typical use of this class.
typedef Matrix<Scalar, SizeMinusOne, 1, Options & ~RowMajor, MaxSizeMinusOne, 1> Eigen::HessenbergDecomposition< _MatrixType >::CoeffVectorType |
Type for vector of Householder coefficients.
This is column vector with entries of type Scalar. The length of the vector is one less than the size of MatrixType, if it is a fixed-side type.
typedef HouseholderSequence<MatrixType,typename internal::remove_all<typename CoeffVectorType::ConjugateReturnType>::type> Eigen::HessenbergDecomposition< _MatrixType >::HouseholderSequenceType |
Return type of matrixQ()
typedef Eigen::Index Eigen::HessenbergDecomposition< _MatrixType >::Index |
typedef internal::HessenbergDecompositionMatrixHReturnType<MatrixType> Eigen::HessenbergDecomposition< _MatrixType >::MatrixHReturnType |
typedef _MatrixType Eigen::HessenbergDecomposition< _MatrixType >::MatrixType |
Synonym for the template parameter _MatrixType
.
typedef MatrixType::Scalar Eigen::HessenbergDecomposition< _MatrixType >::Scalar |
Scalar type for matrices of type MatrixType.
anonymous enum |
|
inlineexplicit |
Default constructor; the decomposition will be computed later.
[in] | size | The size of the matrix whose Hessenberg 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 |
|
inline |
Computes Hessenberg decomposition of given matrix.
[in] | matrix | Square matrix whose Hessenberg decomposition is to be computed. |
*this
The Hessenberg decomposition is computed by bringing the columns of the matrix successively in the required form using Householder reflections (see, e.g., Algorithm 7.4.2 in Golub & Van Loan, Matrix Computations). The cost is \( 10n^3/3 \) flops, where \( n \) denotes the size of the given matrix.
This method reuses of the allocated data in the HessenbergDecomposition object.
Example:
Output:
|
inline |
Returns the Householder coefficients.
The Householder coefficients allow the reconstruction of the matrix \( Q \) in the Hessenberg decomposition from the packed data.
|
inline |
Constructs the Hessenberg matrix H in the decomposition.
The object returned by this function constructs the Hessenberg matrix H when it is assigned to a matrix or otherwise evaluated. The matrix H is constructed from the packed matrix as returned by packedMatrix(): The upper part (including the subdiagonal) of the packed matrix contains the matrix H. It may sometimes be better to directly use the packed matrix instead of constructing the matrix H.
Example:
Output:
|
inline |
Reconstructs the orthogonal 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.
|
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:
|
protected |
|
protected |
|
protected |
|
protected |