WPILibC++ 2023.4.3
|
\eigenvalues_module More...
Public Types | |
enum | { RowsAtCompileTime = MatrixType::RowsAtCompileTime , ColsAtCompileTime = MatrixType::ColsAtCompileTime , Options = MatrixType::Options , MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime , MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
typedef _MatrixType | MatrixType |
typedef MatrixType::Scalar | Scalar |
Scalar type for matrices of type _MatrixType . More... | |
typedef NumTraits< Scalar >::Real | RealScalar |
typedef Eigen::Index | Index |
typedef std::complex< RealScalar > | ComplexScalar |
Complex scalar type for _MatrixType . More... | |
typedef Matrix< ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, MaxColsAtCompileTime > | ComplexMatrixType |
Type for the matrices in the Schur decomposition. More... | |
Public Member Functions | |
ComplexSchur (Index size=RowsAtCompileTime==Dynamic ? 1 :RowsAtCompileTime) | |
Default constructor. More... | |
template<typename InputType > | |
ComplexSchur (const EigenBase< InputType > &matrix, bool computeU=true) | |
Constructor; computes Schur decomposition of given matrix. More... | |
const ComplexMatrixType & | matrixU () const |
Returns the unitary matrix in the Schur decomposition. More... | |
const ComplexMatrixType & | matrixT () const |
Returns the triangular matrix in the Schur decomposition. More... | |
template<typename InputType > | |
ComplexSchur & | compute (const EigenBase< InputType > &matrix, bool computeU=true) |
Computes Schur decomposition of given matrix. More... | |
template<typename HessMatrixType , typename OrthMatrixType > | |
ComplexSchur & | computeFromHessenberg (const HessMatrixType &matrixH, const OrthMatrixType &matrixQ, bool computeU=true) |
Compute Schur decomposition from a given Hessenberg matrix. More... | |
ComputationInfo | info () const |
Reports whether previous computation was successful. More... | |
ComplexSchur & | setMaxIterations (Index maxIters) |
Sets the maximum number of iterations allowed. More... | |
Index | getMaxIterations () |
Returns the maximum number of iterations. More... | |
template<typename InputType > | |
ComplexSchur< MatrixType > & | compute (const EigenBase< InputType > &matrix, bool computeU) |
template<typename HessMatrixType , typename OrthMatrixType > | |
ComplexSchur< MatrixType > & | computeFromHessenberg (const HessMatrixType &matrixH, const OrthMatrixType &matrixQ, bool computeU) |
Static Public Attributes | |
static const int | m_maxIterationsPerRow = 30 |
Maximum number of iterations per row. More... | |
Protected Attributes | |
ComplexMatrixType | m_matT |
ComplexMatrixType | m_matU |
HessenbergDecomposition< MatrixType > | m_hess |
ComputationInfo | m_info |
bool | m_isInitialized |
bool | m_matUisUptodate |
Index | m_maxIters |
Friends | |
struct | internal::complex_schur_reduce_to_hessenberg< MatrixType, NumTraits< Scalar >::IsComplex > |
\eigenvalues_module
Performs a complex Schur decomposition of a real or complex square matrix
_MatrixType | the type of the matrix of which we are computing the Schur decomposition; this is expected to be an instantiation of the Matrix class template. |
Given a real or complex square matrix A, this class computes the Schur decomposition: \( A = U T U^*\) where U is a unitary complex matrix, and T is a complex upper triangular matrix. The diagonal of the matrix T corresponds to the eigenvalues of the matrix A.
Call the function compute() to compute the Schur decomposition of a given matrix. Alternatively, you can use the ComplexSchur(const MatrixType&, bool) constructor which computes the Schur decomposition at construction time. Once the decomposition is computed, you can use the matrixU() and matrixT() functions to retrieve the matrices U and V in the decomposition.
typedef Matrix<ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, MaxColsAtCompileTime> Eigen::ComplexSchur< _MatrixType >::ComplexMatrixType |
Type for the matrices in the Schur decomposition.
This is a square matrix with entries of type ComplexScalar. The size is the same as the size of _MatrixType
.
typedef std::complex<RealScalar> Eigen::ComplexSchur< _MatrixType >::ComplexScalar |
typedef Eigen::Index Eigen::ComplexSchur< _MatrixType >::Index |
typedef _MatrixType Eigen::ComplexSchur< _MatrixType >::MatrixType |
typedef NumTraits<Scalar>::Real Eigen::ComplexSchur< _MatrixType >::RealScalar |
typedef MatrixType::Scalar Eigen::ComplexSchur< _MatrixType >::Scalar |
Scalar type for matrices of type _MatrixType
.
anonymous enum |
|
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.
|
inlineexplicit |
Constructor; 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 constructor calls compute() to compute the Schur decomposition.
ComplexSchur< MatrixType > & Eigen::ComplexSchur< _MatrixType >::compute | ( | const EigenBase< InputType > & | matrix, |
bool | computeU | ||
) |
ComplexSchur & Eigen::ComplexSchur< _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 QR iterations with a single shift. The cost of computing the Schur decomposition depends on the number of iterations; as a rough guide, it may be taken on the number of iterations; as a rough guide, it may be taken to be \(25n^3\) complex flops, or \(10n^3\) complex flops if computeU is false.
Example:
Output:
ComplexSchur< MatrixType > & Eigen::ComplexSchur< _MatrixType >::computeFromHessenberg | ( | const HessMatrixType & | matrixH, |
const OrthMatrixType & | matrixQ, | ||
bool | computeU | ||
) |
ComplexSchur & Eigen::ComplexSchur< _MatrixType >::computeFromHessenberg | ( | const HessMatrixType & | matrixH, |
const OrthMatrixType & | matrixQ, | ||
bool | computeU = true |
||
) |
Compute Schur decomposition from a given Hessenberg matrix.
[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())
|
inline |
Returns the maximum number of iterations.
|
inline |
Reports whether previous computation was successful.
Success
if computation was successful, NoConvergence
otherwise.
|
inline |
Returns the triangular matrix in the Schur decomposition.
It is assumed that either the constructor ComplexSchur(const MatrixType& matrix, bool computeU) or the member function compute(const MatrixType& matrix, bool computeU) has been called before to compute the Schur decomposition of a matrix.
Note that this function returns a plain square matrix. If you want to reference only the upper triangular part, use:
Example:
Output:
|
inline |
Returns the unitary matrix in the Schur decomposition.
It is assumed that either the constructor ComplexSchur(const MatrixType& matrix, bool computeU) or the member function compute(const MatrixType& matrix, bool computeU) has been called before to compute the Schur decomposition of a matrix, and that computeU
was set to true (the default value).
Example:
Output:
|
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.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
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 30.
|
protected |