Performs a real Schur decomposition of a square matrix. More...
#include <RealSchur.h>
Public Types | |
enum | { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, Options = MatrixType::Options, MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
typedef Matrix< Scalar, ColsAtCompileTime, 1, Options &~RowMajor, MaxColsAtCompileTime, 1 > | ColumnVectorType |
typedef std::complex< typename NumTraits< Scalar >::Real > | ComplexScalar |
typedef Matrix< ComplexScalar, ColsAtCompileTime, 1, Options &~RowMajor, MaxColsAtCompileTime, 1 > | EigenvalueType |
typedef Eigen::Index | Index |
typedef _MatrixType | MatrixType |
typedef MatrixType::Scalar | Scalar |
Public Member Functions | |
template<typename InputType > | |
RealSchur & | compute (const EigenBase< InputType > &matrix, bool computeU=true) |
Computes Schur decomposition of given matrix. More... | |
template<typename InputType > | |
RealSchur< MatrixType > & | compute (const EigenBase< InputType > &matrix, bool computeU) |
template<typename HessMatrixType , typename OrthMatrixType > | |
RealSchur & | computeFromHessenberg (const HessMatrixType &matrixH, const OrthMatrixType &matrixQ, bool computeU) |
Computes Schur decomposition of a Hessenberg matrix H = Z T Z^T. More... | |
template<typename HessMatrixType , typename OrthMatrixType > | |
RealSchur< MatrixType > & | computeFromHessenberg (const HessMatrixType &matrixH, const OrthMatrixType &matrixQ, bool computeU) |
Index | getMaxIterations () |
Returns the maximum number of iterations. More... | |
ComputationInfo | info () const |
Reports whether previous computation was successful. More... | |
const MatrixType & | matrixT () const |
Returns the quasi-triangular matrix in the Schur decomposition. More... | |
const MatrixType & | matrixU () const |
Returns the orthogonal matrix in the Schur decomposition. More... | |
RealSchur (Index size=RowsAtCompileTime==Dynamic?1:RowsAtCompileTime) | |
Default constructor. More... | |
template<typename InputType > | |
RealSchur (const EigenBase< InputType > &matrix, bool computeU=true) | |
Constructor; computes real Schur decomposition of given matrix. More... | |
RealSchur & | setMaxIterations (Index maxIters) |
Sets the maximum number of iterations allowed. More... | |
Static Public Attributes | |
static const int | m_maxIterationsPerRow = 40 |
Maximum number of iterations per row. More... | |
Private Types | |
typedef Matrix< Scalar, 3, 1 > | Vector3s |
Private Member Functions | |
Scalar | computeNormOfT () |
void | computeShift (Index iu, Index iter, Scalar &exshift, Vector3s &shiftInfo) |
Index | findSmallSubdiagEntry (Index iu) |
void | initFrancisQRStep (Index il, Index iu, const Vector3s &shiftInfo, Index &im, Vector3s &firstHouseholderVector) |
void | performFrancisQRStep (Index il, Index im, Index iu, bool computeU, const Vector3s &firstHouseholderVector, Scalar *workspace) |
void | splitOffTwoRows (Index iu, bool computeU, const Scalar &exshift) |
Private Attributes | |
HessenbergDecomposition< MatrixType > | m_hess |
ComputationInfo | m_info |
bool | m_isInitialized |
MatrixType | m_matT |
MatrixType | m_matU |
bool | m_matUisUptodate |
Index | m_maxIters |
ColumnVectorType | m_workspaceVector |
Performs a real Schur decomposition of a square matrix.
_MatrixType | the type of the matrix of which we are computing the real Schur decomposition; this is expected to be an instantiation of the Matrix class template. |
Given a real square matrix A, this class computes the real Schur decomposition: where U is a real orthogonal matrix and T is a real quasi-triangular matrix. An orthogonal matrix is a matrix whose inverse is equal to its transpose, . A quasi-triangular matrix is a block-triangular matrix whose diagonal consists of 1-by-1 blocks and 2-by-2 blocks with complex eigenvalues. The eigenvalues of the blocks on the diagonal of T are the same as the eigenvalues of the matrix A, and thus the real Schur decomposition is used in EigenSolver to compute the eigendecomposition of a matrix.
Call the function compute() to compute the real Schur decomposition of a given matrix. Alternatively, you can use the RealSchur(const MatrixType&, bool) constructor which computes the real Schur decomposition at construction time. Once the decomposition is computed, you can use the matrixU() and matrixT() functions to retrieve the matrices U and T in the decomposition.
The documentation of RealSchur(const MatrixType&, bool) contains an example of the typical use of this class.
Definition at line 54 of file RealSchur.h.
typedef Matrix<Scalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealSchur< _MatrixType >::ColumnVectorType |
Definition at line 70 of file RealSchur.h.
typedef std::complex<typename NumTraits<Scalar>::Real> Eigen::RealSchur< _MatrixType >::ComplexScalar |
Definition at line 66 of file RealSchur.h.
typedef Matrix<ComplexScalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealSchur< _MatrixType >::EigenvalueType |
Definition at line 69 of file RealSchur.h.
typedef Eigen::Index Eigen::RealSchur< _MatrixType >::Index |
Definition at line 67 of file RealSchur.h.
typedef _MatrixType Eigen::RealSchur< _MatrixType >::MatrixType |
Definition at line 57 of file RealSchur.h.
typedef MatrixType::Scalar Eigen::RealSchur< _MatrixType >::Scalar |
Definition at line 65 of file RealSchur.h.
|
private |
Definition at line 236 of file RealSchur.h.
anonymous enum |
Enumerator | |
---|---|
RowsAtCompileTime | |
ColsAtCompileTime | |
Options | |
MaxRowsAtCompileTime | |
MaxColsAtCompileTime |
Definition at line 58 of file RealSchur.h.
|
inlineexplicit |
Default constructor.
[in] | size | Positive integer, size of the matrix whose Schur 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.
Definition at line 83 of file RealSchur.h.
|
inlineexplicit |
Constructor; computes real Schur decomposition of given matrix.
[in] | matrix | Square matrix whose Schur decomposition is to be computed. |
[in] | computeU | If true, both T and U are computed; if false, only T is computed. |
This constructor calls compute() to compute the Schur decomposition.
Example:
Output:
Definition at line 104 of file RealSchur.h.
RealSchur& Eigen::RealSchur< _MatrixType >::compute | ( | const EigenBase< InputType > & | matrix, |
bool | computeU = true |
||
) |
Computes Schur decomposition of given matrix.
[in] | matrix | Square matrix whose Schur decomposition is to be computed. |
[in] | computeU | If true, both T and U are computed; if false, only T is computed. |
*this
The Schur decomposition is computed by first reducing the matrix to Hessenberg form using the class HessenbergDecomposition. The Hessenberg matrix is then reduced to triangular form by performing Francis QR iterations with implicit double shift. The cost of computing the Schur decomposition depends on the number of iterations; as a rough guide, it may be taken to be flops if computeU is true and flops if computeU is false.
Example:
Output:
RealSchur<MatrixType>& Eigen::RealSchur< _MatrixType >::compute | ( | const EigenBase< InputType > & | matrix, |
bool | computeU | ||
) |
Definition at line 249 of file RealSchur.h.
RealSchur& Eigen::RealSchur< _MatrixType >::computeFromHessenberg | ( | const HessMatrixType & | matrixH, |
const OrthMatrixType & | matrixQ, | ||
bool | computeU | ||
) |
Computes Schur decomposition of a Hessenberg matrix H = Z T Z^T.
[in] | matrixH | Matrix in Hessenberg form H |
[in] | matrixQ | orthogonal matrix Q that transform a matrix A to H : A = Q H Q^T |
computeU | Computes the matriX U of the Schur vectors |
*this
This routine assumes that the matrix is already reduced in Hessenberg form matrixH using either the class HessenbergDecomposition or another mean. It computes the upper quasi-triangular matrix T of the Schur decomposition of H When computeU is true, this routine computes the matrix U such that A = U T U^T = (QZ) T (QZ)^T = Q H Q^T where A is the initial matrix
NOTE Q is referenced if computeU is true; so, if the initial orthogonal matrix is not available, the user should give an identity matrix (Q.setIdentity())
RealSchur<MatrixType>& Eigen::RealSchur< _MatrixType >::computeFromHessenberg | ( | const HessMatrixType & | matrixH, |
const OrthMatrixType & | matrixQ, | ||
bool | computeU | ||
) |
Definition at line 282 of file RealSchur.h.
|
inlineprivate |
Definition at line 353 of file RealSchur.h.
|
inlineprivate |
Definition at line 418 of file RealSchur.h.
|
inlineprivate |
Definition at line 367 of file RealSchur.h.
|
inline |
Returns the maximum number of iterations.
Definition at line 213 of file RealSchur.h.
|
inline |
Reports whether previous computation was successful.
Success
if computation was succesful, NoConvergence
otherwise. Definition at line 195 of file RealSchur.h.
|
inlineprivate |
Definition at line 460 of file RealSchur.h.
|
inline |
Returns the quasi-triangular matrix in the Schur decomposition.
Definition at line 144 of file RealSchur.h.
|
inline |
Returns the orthogonal matrix in the Schur decomposition.
computeU
was set to true (the default value).Definition at line 127 of file RealSchur.h.
|
inlineprivate |
Definition at line 485 of file RealSchur.h.
|
inline |
Sets the maximum number of iterations allowed.
If not specified by the user, the maximum number of iterations is m_maxIterationsPerRow times the size of the matrix.
Definition at line 206 of file RealSchur.h.
|
inlineprivate |
Definition at line 383 of file RealSchur.h.
|
private |
Definition at line 230 of file RealSchur.h.
|
private |
Definition at line 231 of file RealSchur.h.
|
private |
Definition at line 232 of file RealSchur.h.
|
private |
Definition at line 227 of file RealSchur.h.
|
private |
Definition at line 228 of file RealSchur.h.
|
private |
Definition at line 233 of file RealSchur.h.
|
static |
Maximum number of iterations per row.
If not otherwise specified, the maximum number of iterations is this number times the size of the matrix. It is currently set to 40.
Definition at line 223 of file RealSchur.h.
|
private |
Definition at line 234 of file RealSchur.h.
|
private |
Definition at line 229 of file RealSchur.h.