![]() |
|
Performs a real QZ decomposition of a pair of square matrices. More...
#include <RealQZ.h>
Public Types | |
enum | { RowsAtCompileTime = MatrixType::RowsAtCompileTime , ColsAtCompileTime = MatrixType::ColsAtCompileTime , Options = internal::traits<MatrixType>::Options , MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime , MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
typedef MatrixType_ | MatrixType |
typedef MatrixType::Scalar | Scalar |
typedef std::complex< typename NumTraits< Scalar >::Real > | ComplexScalar |
typedef Eigen::Index | Index |
typedef Matrix< ComplexScalar, ColsAtCompileTime, 1, Options &~RowMajor, MaxColsAtCompileTime, 1 > | EigenvalueType |
typedef Matrix< Scalar, ColsAtCompileTime, 1, Options &~RowMajor, MaxColsAtCompileTime, 1 > | ColumnVectorType |
Public Member Functions | |
RealQZ (Index size=RowsAtCompileTime==Dynamic ? 1 :RowsAtCompileTime) | |
Default constructor. More... | |
RealQZ (const MatrixType &A, const MatrixType &B, bool computeQZ=true) | |
Constructor; computes real QZ decomposition of given matrices. More... | |
const MatrixType & | matrixQ () const |
Returns matrix Q in the QZ decomposition. More... | |
const MatrixType & | matrixZ () const |
Returns matrix Z in the QZ decomposition. More... | |
const MatrixType & | matrixS () const |
Returns matrix S in the QZ decomposition. More... | |
const MatrixType & | matrixT () const |
Returns matrix S in the QZ decomposition. More... | |
RealQZ & | compute (const MatrixType &A, const MatrixType &B, bool computeQZ=true) |
Computes QZ decomposition of given matrix. More... | |
ComputationInfo | info () const |
Reports whether previous computation was successful. More... | |
Index | iterations () const |
Returns number of performed QR-like iterations. More... | |
RealQZ & | setMaxIterations (Index maxIters) |
Private Types | |
typedef Matrix< Scalar, 3, 1 > | Vector3s |
typedef Matrix< Scalar, 2, 1 > | Vector2s |
typedef Matrix< Scalar, 2, 2 > | Matrix2s |
typedef JacobiRotation< Scalar > | JRs |
Private Member Functions | |
void | hessenbergTriangular () |
void | computeNorms () |
Index | findSmallSubdiagEntry (Index iu) |
Index | findSmallDiagEntry (Index f, Index l) |
void | splitOffTwoRows (Index i) |
void | pushDownZero (Index z, Index f, Index l) |
void | step (Index f, Index l, Index iter) |
Private Attributes | |
MatrixType | m_S |
MatrixType | m_T |
MatrixType | m_Q |
MatrixType | m_Z |
Matrix< Scalar, Dynamic, 1 > | m_workspace |
ComputationInfo | m_info |
Index | m_maxIters |
bool | m_isInitialized |
bool | m_computeQZ |
Scalar | m_normOfT |
Scalar | m_normOfS |
Index | m_global_iter |
Performs a real QZ decomposition of a pair of square matrices.
\eigenvalues_module
MatrixType_ | the type of the matrix of which we are computing the real QZ decomposition; this is expected to be an instantiation of the Matrix class template. |
Given a real square matrices A and B, this class computes the real QZ decomposition: \( A = Q S Z \), \( B = Q T Z \) where Q and Z are real orthogonal matrixes, T is upper-triangular matrix, and S is upper quasi-triangular matrix. An orthogonal matrix is a matrix whose inverse is equal to its transpose, \( U^{-1} = U^T \). A quasi-triangular matrix is a block-triangular matrix whose diagonal consists of 1-by-1 blocks and 2-by-2 blocks where further reduction is impossible due to complex eigenvalues.
The eigenvalues of the pencil \( A - z B \) can be obtained from 1x1 and 2x2 blocks on the diagonals of S and T.
Call the function compute() to compute the real QZ decomposition of a given pair of matrices. Alternatively, you can use the RealQZ(const MatrixType& B, const MatrixType& B, bool computeQZ) constructor which computes the real QZ decomposition at construction time. Once the decomposition is computed, you can use the matrixS(), matrixT(), matrixQ() and matrixZ() functions to retrieve the matrices S, T, Q and Z in the decomposition. If computeQZ==false, some time is saved by not computing matrices Q and Z.
Example:
Output:
typedef Matrix<Scalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealQZ< MatrixType_ >::ColumnVectorType |
typedef std::complex<typename NumTraits<Scalar>::Real> Eigen::RealQZ< MatrixType_ >::ComplexScalar |
typedef Matrix<ComplexScalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealQZ< MatrixType_ >::EigenvalueType |
typedef Eigen::Index Eigen::RealQZ< MatrixType_ >::Index |
|
private |
|
private |
typedef MatrixType_ Eigen::RealQZ< MatrixType_ >::MatrixType |
typedef MatrixType::Scalar Eigen::RealQZ< MatrixType_ >::Scalar |
|
private |
|
private |
anonymous enum |
|
inlineexplicit |
Default constructor.
[in] | size | Positive integer, size of the matrix whose QZ 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.
|
inline |
Constructor; computes real QZ decomposition of given matrices.
[in] | A | Matrix A. |
[in] | B | Matrix B. |
[in] | computeQZ | If false, A and Z are not computed. |
This constructor calls compute() to compute the QZ decomposition.
References Eigen::RealQZ< MatrixType_ >::compute().
RealQZ< MatrixType > & Eigen::RealQZ< MatrixType >::compute | ( | const MatrixType & | A, |
const MatrixType & | B, | ||
bool | computeQZ = true |
||
) |
Computes QZ decomposition of given matrix.
[in] | A | Matrix A. |
[in] | B | Matrix B. |
[in] | computeQZ | If false, A and Z are not computed. |
*this
References eigen_assert, f(), i, Eigen::numext::is_exactly_zero(), Eigen::NoConvergence, Eigen::internal::real_2x2_jacobi_svd(), Eigen::Success, and Eigen::JacobiRotation< Scalar >::transpose().
Referenced by Eigen::GeneralizedEigenSolver< MatrixType_ >::compute(), and Eigen::RealQZ< MatrixType_ >::RealQZ().
|
inlineprivate |
Computes vector L1 norms of S and T when in Hessenberg-Triangular form already
|
inlineprivate |
Look for single small diagonal element T(res, res) for res between f and l, and return res (or f-1)
|
inlineprivate |
Look for single small sub-diagonal element S(res, res-1) and return res (or 0)
References abs(), Eigen::numext::is_exactly_zero(), res, and s.
|
private |
Reduces S and T to upper Hessenberg - triangular form
References G, Eigen::HouseholderQR< MatrixType_ >::householderQ(), i, Eigen::numext::is_exactly_zero(), j, and Eigen::HouseholderQR< MatrixType_ >::matrixQR().
|
inline |
Reports whether previous computation was successful.
Success
if computation was successful, NoConvergence
otherwise. References eigen_assert, Eigen::RealQZ< MatrixType_ >::m_info, and Eigen::RealQZ< MatrixType_ >::m_isInitialized.
Referenced by Eigen::GeneralizedEigenSolver< MatrixType_ >::compute(), and Eigen::GeneralizedEigenSolver< MatrixType_ >::info().
|
inline |
Returns number of performed QR-like iterations.
References eigen_assert, Eigen::RealQZ< MatrixType_ >::m_global_iter, and Eigen::RealQZ< MatrixType_ >::m_isInitialized.
|
inline |
Returns matrix Q in the QZ decomposition.
References eigen_assert, Eigen::RealQZ< MatrixType_ >::m_computeQZ, Eigen::RealQZ< MatrixType_ >::m_isInitialized, and Eigen::RealQZ< MatrixType_ >::m_Q.
|
inline |
Returns matrix S in the QZ decomposition.
References eigen_assert, Eigen::RealQZ< MatrixType_ >::m_isInitialized, and Eigen::RealQZ< MatrixType_ >::m_S.
Referenced by Eigen::GeneralizedEigenSolver< MatrixType_ >::compute().
|
inline |
Returns matrix S in the QZ decomposition.
References eigen_assert, Eigen::RealQZ< MatrixType_ >::m_isInitialized, and Eigen::RealQZ< MatrixType_ >::m_T.
Referenced by Eigen::GeneralizedEigenSolver< MatrixType_ >::compute().
|
inline |
Returns matrix Z in the QZ decomposition.
References eigen_assert, Eigen::RealQZ< MatrixType_ >::m_computeQZ, Eigen::RealQZ< MatrixType_ >::m_isInitialized, and Eigen::RealQZ< MatrixType_ >::m_Z.
Referenced by Eigen::GeneralizedEigenSolver< MatrixType_ >::compute().
|
inlineprivate |
use zero in T(z,z) to zero S(l,l-1), working in block f..l
|
inline |
Sets the maximal number of iterations allowed to converge to one eigenvalue or decouple the problem.
References Eigen::RealQZ< MatrixType_ >::m_maxIters.
Referenced by Eigen::GeneralizedEigenSolver< MatrixType_ >::setMaxIterations().
|
inlineprivate |
|
inlineprivate |
QR-like iterative step for block f..l
References abs(), beta, Eigen::PlainObjectBase< Derived >::coeff(), Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::coeffRef(), Eigen::PlainObjectBase< Derived >::data(), f(), G, k, max, min, tmp, plotDoE::x, and y.
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::matrixQ(), and Eigen::RealQZ< MatrixType_ >::matrixZ().
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::iterations().
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::info().
|
private |
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::setMaxIterations().
|
private |
|
private |
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::matrixQ().
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::matrixS().
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::matrixT().
|
private |
|
private |
Referenced by Eigen::RealQZ< MatrixType_ >::matrixZ().