Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: MPC_current_control HydraulicControlBoard_SW AHRS Test_ekf ... more
Tridiagonalization< _MatrixType > Class Template Reference
[Eigenvalues module]
#include <Tridiagonalization.h>
Public Types | |
typedef _MatrixType | MatrixType |
Synonym for the template parameter _MatrixType . | |
typedef HouseholderSequence < MatrixType, typename internal::remove_all< typename CoeffVectorType::ConjugateReturnType > ::type > | HouseholderSequenceType |
Return type of matrixQ() | |
Public Member Functions | |
Tridiagonalization (Index size=Size==Dynamic?2:Size) | |
Default constructor. | |
Tridiagonalization (const MatrixType &matrix) | |
Constructor; computes tridiagonal decomposition of given matrix. | |
Tridiagonalization & | compute (const MatrixType &matrix) |
Computes tridiagonal decomposition of given matrix. | |
CoeffVectorType | householderCoefficients () const |
Returns the Householder coefficients. | |
const MatrixType & | packedMatrix () const |
Returns the internal representation of the decomposition. | |
HouseholderSequenceType | matrixQ () const |
Returns the unitary matrix Q in the decomposition. | |
MatrixTReturnType | matrixT () const |
Returns an expression of the tridiagonal matrix T in the decomposition. | |
DiagonalReturnType | diagonal () const |
Returns the diagonal of the tridiagonal matrix T in the decomposition. | |
SubDiagonalReturnType | subDiagonal () const |
Returns the subdiagonal of the tridiagonal matrix T in the decomposition. |
Detailed Description
template<typename _MatrixType>
class Eigen::Tridiagonalization< _MatrixType >
Tridiagonal decomposition of a selfadjoint matrix
- Template Parameters:
-
_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 such that:
where
is unitary and
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.
- See also:
- class HessenbergDecomposition, class SelfAdjointEigenSolver
Definition at line 61 of file Tridiagonalization.h.
Member Typedef Documentation
typedef HouseholderSequence<MatrixType,typename internal::remove_all<typename CoeffVectorType::ConjugateReturnType>::type> HouseholderSequenceType |
Return type of matrixQ()
Definition at line 99 of file Tridiagonalization.h.
typedef _MatrixType MatrixType |
Synonym for the template parameter _MatrixType
.
Definition at line 66 of file Tridiagonalization.h.
Constructor & Destructor Documentation
Tridiagonalization | ( | Index | size = Size==Dynamic ? 2 : Size ) |
Default constructor.
- Parameters:
-
[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.
- See also:
- compute() for an example.
Definition at line 113 of file Tridiagonalization.h.
Tridiagonalization | ( | const MatrixType & | matrix ) |
Constructor; computes tridiagonal decomposition of given matrix.
- Parameters:
-
[in] matrix Selfadjoint matrix whose tridiagonal decomposition is to be computed.
This constructor calls compute() to compute the tridiagonal decomposition.
Example:
Output:
Definition at line 129 of file Tridiagonalization.h.
Member Function Documentation
Tridiagonalization& compute | ( | const MatrixType & | matrix ) |
Computes tridiagonal decomposition of given matrix.
- Parameters:
-
[in] matrix Selfadjoint matrix whose tridiagonal decomposition is to be computed.
- Returns:
- Reference to
*this
The tridiagonal decomposition is computed by bringing the columns of the matrix successively in the required form using Householder reflections. The cost is flops, where
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:
Definition at line 155 of file Tridiagonalization.h.
Tridiagonalization< MatrixType >::DiagonalReturnType diagonal | ( | ) | const |
Returns the diagonal of the tridiagonal matrix T in the decomposition.
- Returns:
- expression representing the diagonal of T
- Precondition:
- Either the constructor Tridiagonalization(const MatrixType&) or the member function compute(const MatrixType&) has been called before to compute the tridiagonal decomposition of a matrix.
Example:
Output:
- See also:
- matrixT(), subDiagonal()
Definition at line 305 of file Tridiagonalization.h.
CoeffVectorType householderCoefficients | ( | ) | const |
Returns the Householder coefficients.
- Returns:
- a const reference to the vector of Householder coefficients
- Precondition:
- Either the constructor Tridiagonalization(const MatrixType&) or the member function compute(const MatrixType&) has been called before to compute the tridiagonal decomposition of a matrix.
The Householder coefficients allow the reconstruction of the matrix in the tridiagonal decomposition from the packed data.
Example:
Output:
- See also:
- packedMatrix(), Householder module
Definition at line 180 of file Tridiagonalization.h.
HouseholderSequenceType matrixQ | ( | ) | const |
Returns the unitary matrix Q in the decomposition.
- Returns:
- object representing the matrix Q
- Precondition:
- Either the constructor Tridiagonalization(const MatrixType&) or the member function compute(const MatrixType&) has been called before to compute the tridiagonal decomposition of a matrix.
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.
- See also:
- Tridiagonalization(const MatrixType&) for an example, matrixT(), class HouseholderSequence
Definition at line 238 of file Tridiagonalization.h.
MatrixTReturnType matrixT | ( | ) | const |
Returns an expression of the tridiagonal matrix T in the decomposition.
- Returns:
- expression object representing the matrix T
- Precondition:
- Either the constructor Tridiagonalization(const MatrixType&) or the member function compute(const MatrixType&) has been called before to compute the tridiagonal decomposition of a matrix.
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.
- See also:
- Tridiagonalization(const MatrixType&) for an example, matrixQ(), packedMatrix(), diagonal(), subDiagonal()
Definition at line 263 of file Tridiagonalization.h.
const MatrixType& packedMatrix | ( | ) | const |
Returns the internal representation of the decomposition.
- Returns:
- a const reference to a matrix with the internal representation of the decomposition.
- Precondition:
- Either the constructor Tridiagonalization(const MatrixType&) or the member function compute(const MatrixType&) has been called before to compute the tridiagonal decomposition of a matrix.
The returned matrix contains the following information:
- the strict upper triangular part is equal to the input matrix A.
- the diagonal and lower sub-diagonal represent the real tridiagonal symmetric matrix T.
- the rest of the lower part contains the Householder vectors that, combined with Householder coefficients returned by householderCoefficients(), allows to reconstruct the matrix Q as
. Here, the matrices
are the Householder transformations
where
is the
th Householder coefficient and
is the Householder vector defined by
with M the matrix returned by this function.
See LAPACK for further details on this packed storage.
Example:
Output:
- See also:
- householderCoefficients()
Definition at line 217 of file Tridiagonalization.h.
Tridiagonalization< MatrixType >::SubDiagonalReturnType subDiagonal | ( | ) | const |
Returns the subdiagonal of the tridiagonal matrix T in the decomposition.
- Returns:
- expression representing the subdiagonal of T
- Precondition:
- Either the constructor Tridiagonalization(const MatrixType&) or the member function compute(const MatrixType&) has been called before to compute the tridiagonal decomposition of a matrix.
- See also:
- diagonal() for an example, matrixT()
Definition at line 313 of file Tridiagonalization.h.
Generated on Tue Jul 12 2022 17:34:20 by
