Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Friends

Eigen::ComplexSchur< _MatrixType > Class Template Reference


Detailed Description

template<typename _MatrixType>
class Eigen::ComplexSchur< _MatrixType >

Performs a complex Schur decomposition of a real or complex square matrix

Template Parameters:
_MatrixTypethe 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.

Note:
This code is inspired from Jampack
See also:
class RealSchur, class EigenSolver, class ComplexEigenSolver

Definition at line 65 of file Eigenvalues.

Inheritance diagram for Eigen::ComplexSchur< _MatrixType >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  {
  RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, Options = MatrixType::Options, MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
  MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
}
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.
typedef NumTraits< Scalar >::Real RealScalar
typedef MatrixType::Index Index
typedef std::complex< RealScalarComplexScalar
 Complex scalar type for _MatrixType.
typedef Matrix< ComplexScalar,
RowsAtCompileTime,
ColsAtCompileTime, Options,
MaxRowsAtCompileTime,
MaxColsAtCompileTime > 
ComplexMatrixType
 Type for the matrices in the Schur decomposition.
typedef _MatrixType MatrixType
typedef MatrixType::Scalar Scalar
 Scalar type for matrices of type _MatrixType.
typedef NumTraits< Scalar >::Real RealScalar
typedef MatrixType::Index Index
typedef std::complex< RealScalarComplexScalar
 Complex scalar type for _MatrixType.
typedef Matrix< ComplexScalar,
RowsAtCompileTime,
ColsAtCompileTime, Options,
MaxRowsAtCompileTime,
MaxColsAtCompileTime > 
ComplexMatrixType
 Type for the matrices in the Schur decomposition.

Public Member Functions

 ComplexSchur (Index size=RowsAtCompileTime==Dynamic?1:RowsAtCompileTime)
 Default constructor.
 ComplexSchur (const MatrixType &matrix, bool computeU=true)
 Constructor; computes Schur decomposition of given matrix.
const ComplexMatrixTypematrixU () const
 Returns the unitary matrix in the Schur decomposition.
const ComplexMatrixTypematrixT () const
 Returns the triangular matrix in the Schur decomposition.
ComplexSchurcompute (const MatrixType &matrix, bool computeU=true)
 Computes Schur decomposition of given matrix.
ComputationInfo info () const
 Reports whether previous computation was successful.
 ComplexSchur (Index size=RowsAtCompileTime==Dynamic?1:RowsAtCompileTime)
 Default constructor.
 ComplexSchur (const MatrixType &matrix, bool computeU=true)
 Constructor; computes Schur decomposition of given matrix.
const ComplexMatrixTypematrixU () const
 Returns the unitary matrix in the Schur decomposition.
const ComplexMatrixTypematrixT () const
 Returns the triangular matrix in the Schur decomposition.
ComplexSchurcompute (const MatrixType &matrix, bool computeU=true)
 Computes Schur decomposition of given matrix.
ComputationInfo info () const
 Reports whether previous computation was successful.

Static Public Attributes

static const int m_maxIterations = 30
 Maximum number of iterations.

Protected Attributes

ComplexMatrixType m_matT
ComplexMatrixType m_matU
HessenbergDecomposition
< MatrixType
m_hess
ComputationInfo m_info
bool m_isInitialized
bool m_matUisUptodate

Private Member Functions

bool subdiagonalEntryIsNeglegible (Index i)
 If m_matT(i+1,i) is neglegible in floating point arithmetic compared to m_matT(i,i) and m_matT(j,j), then set it to zero and return true, else return false.
ComplexScalar computeShift (Index iu, Index iter)
 Compute the shift in the current QR iteration.
void reduceToTriangularForm (bool computeU)
bool subdiagonalEntryIsNeglegible (Index i)
ComplexScalar computeShift (Index iu, Index iter)
void reduceToTriangularForm (bool computeU)

Friends

struct internal::complex_schur_reduce_to_hessenberg< MatrixType, NumTraits< Scalar >::IsComplex >

Member Typedef Documentation

template<typename _MatrixType>
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.

Definition at line 95 of file Eigenvalues.

template<typename _MatrixType>
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.

Definition at line 95 of file Eigenvalues.

template<typename _MatrixType>
typedef std::complex<RealScalar> Eigen::ComplexSchur< _MatrixType >::ComplexScalar

Complex scalar type for _MatrixType.

This is std::complex<Scalar> if Scalar is real (e.g., float or double) and just Scalar if Scalar is complex.

Definition at line 88 of file Eigenvalues.

template<typename _MatrixType>
typedef std::complex<RealScalar> Eigen::ComplexSchur< _MatrixType >::ComplexScalar

Complex scalar type for _MatrixType.

This is std::complex<Scalar> if Scalar is real (e.g., float or double) and just Scalar if Scalar is complex.

Definition at line 88 of file Eigenvalues.

template<typename _MatrixType>
typedef MatrixType::Index Eigen::ComplexSchur< _MatrixType >::Index

Definition at line 80 of file Eigenvalues.

template<typename _MatrixType>
typedef MatrixType::Index Eigen::ComplexSchur< _MatrixType >::Index

Definition at line 80 of file Eigenvalues.

template<typename _MatrixType>
typedef _MatrixType Eigen::ComplexSchur< _MatrixType >::MatrixType

Definition at line 68 of file Eigenvalues.

template<typename _MatrixType>
typedef _MatrixType Eigen::ComplexSchur< _MatrixType >::MatrixType

Definition at line 68 of file Eigenvalues.

template<typename _MatrixType>
typedef NumTraits<Scalar>::Real Eigen::ComplexSchur< _MatrixType >::RealScalar

Definition at line 79 of file Eigenvalues.

template<typename _MatrixType>
typedef NumTraits<Scalar>::Real Eigen::ComplexSchur< _MatrixType >::RealScalar

Definition at line 79 of file Eigenvalues.

template<typename _MatrixType>
typedef MatrixType::Scalar Eigen::ComplexSchur< _MatrixType >::Scalar

Scalar type for matrices of type _MatrixType.

Definition at line 78 of file Eigenvalues.

template<typename _MatrixType>
typedef MatrixType::Scalar Eigen::ComplexSchur< _MatrixType >::Scalar

Scalar type for matrices of type _MatrixType.

Definition at line 78 of file Eigenvalues.


Member Enumeration Documentation

template<typename _MatrixType>
anonymous enum
Enumerator:
RowsAtCompileTime 
ColsAtCompileTime 
Options 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 

Definition at line 69 of file Eigenvalues.

template<typename _MatrixType>
anonymous enum
Enumerator:
RowsAtCompileTime 
ColsAtCompileTime 
Options 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 

Definition at line 69 of file Eigenvalues.


Constructor & Destructor Documentation

template<typename _MatrixType>
Eigen::ComplexSchur< _MatrixType >::ComplexSchur ( Index  size = RowsAtCompileTime==Dynamic ? 1 : RowsAtCompileTime) [inline]

Default constructor.

Parameters:
[in]sizePositive 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.

See also:
compute() for an example.

Definition at line 108 of file Eigenvalues.

template<typename _MatrixType>
Eigen::ComplexSchur< _MatrixType >::ComplexSchur ( const MatrixType matrix,
bool  computeU = true 
) [inline]

Constructor; computes Schur decomposition of given matrix.

Parameters:
[in]matrixSquare matrix whose Schur decomposition is to be computed.
[in]computeUIf true, both T and U are computed; if false, only T is computed.

This constructor calls compute() to compute the Schur decomposition.

See also:
matrixT() and matrixU() for examples.

Definition at line 125 of file Eigenvalues.

template<typename _MatrixType>
Eigen::ComplexSchur< _MatrixType >::ComplexSchur ( Index  size = RowsAtCompileTime==Dynamic ? 1 : RowsAtCompileTime) [inline]

Default constructor.

Parameters:
[in]sizePositive 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.

See also:
compute() for an example.

Definition at line 108 of file Eigenvalues.

template<typename _MatrixType>
Eigen::ComplexSchur< _MatrixType >::ComplexSchur ( const MatrixType matrix,
bool  computeU = true 
) [inline]

Constructor; computes Schur decomposition of given matrix.

Parameters:
[in]matrixSquare matrix whose Schur decomposition is to be computed.
[in]computeUIf true, both T and U are computed; if false, only T is computed.

This constructor calls compute() to compute the Schur decomposition.

See also:
matrixT() and matrixU() for examples.

Definition at line 125 of file Eigenvalues.


Member Function Documentation

template<typename MatrixType >
ComplexSchur< MatrixType > & ComplexSchur< MatrixType >::compute ( const MatrixType matrix,
bool  computeU = true 
)

Computes Schur decomposition of given matrix.

Parameters:
[in]matrixSquare matrix whose Schur decomposition is to be computed.
[in]computeUIf true, both T and U are computed; if false, only T is computed.
Returns:
Reference to *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:

Definition at line 325 of file Eigenvalues.

template<typename _MatrixType>
ComplexSchur& Eigen::ComplexSchur< _MatrixType >::compute ( const MatrixType matrix,
bool  computeU = true 
)

Computes Schur decomposition of given matrix.

Parameters:
[in]matrixSquare matrix whose Schur decomposition is to be computed.
[in]computeUIf true, both T and U are computed; if false, only T is computed.
Returns:
Reference to *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:

template<typename MatrixType >
ComplexSchur< MatrixType >::ComplexScalar ComplexSchur< MatrixType >::computeShift ( Index  iu,
Index  iter 
) [private]

Compute the shift in the current QR iteration.

Definition at line 289 of file Eigenvalues.

template<typename _MatrixType>
ComplexScalar Eigen::ComplexSchur< _MatrixType >::computeShift ( Index  iu,
Index  iter 
) [private]
template<typename _MatrixType>
ComputationInfo Eigen::ComplexSchur< _MatrixType >::info ( ) const [inline]

Reports whether previous computation was successful.

Returns:
Success if computation was succesful, NoConvergence otherwise.

Definition at line 204 of file Eigenvalues.

template<typename _MatrixType>
ComputationInfo Eigen::ComplexSchur< _MatrixType >::info ( ) const [inline]

Reports whether previous computation was successful.

Returns:
Success if computation was succesful, NoConvergence otherwise.

Definition at line 204 of file Eigenvalues.

template<typename _MatrixType>
const ComplexMatrixType& Eigen::ComplexSchur< _MatrixType >::matrixT ( ) const [inline]

Returns the triangular matrix in the Schur decomposition.

Returns:
A const reference to the matrix T.

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:

 schur.matrixT().triangularView<Upper>() 

Example:

Output:

Definition at line 173 of file Eigenvalues.

template<typename _MatrixType>
const ComplexMatrixType& Eigen::ComplexSchur< _MatrixType >::matrixT ( ) const [inline]

Returns the triangular matrix in the Schur decomposition.

Returns:
A const reference to the matrix T.

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:

 schur.matrixT().triangularView<Upper>() 

Example:

Output:

Definition at line 173 of file Eigenvalues.

template<typename _MatrixType>
const ComplexMatrixType& Eigen::ComplexSchur< _MatrixType >::matrixU ( ) const [inline]

Returns the unitary matrix in the Schur decomposition.

Returns:
A const reference to the matrix U.

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:

Definition at line 149 of file Eigenvalues.

template<typename _MatrixType>
const ComplexMatrixType& Eigen::ComplexSchur< _MatrixType >::matrixU ( ) const [inline]

Returns the unitary matrix in the Schur decomposition.

Returns:
A const reference to the matrix U.

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:

Definition at line 149 of file Eigenvalues.

template<typename _MatrixType>
void Eigen::ComplexSchur< _MatrixType >::reduceToTriangularForm ( bool  computeU) [private]
template<typename MatrixType >
void ComplexSchur< MatrixType >::reduceToTriangularForm ( bool  computeU) [private]

Definition at line 384 of file Eigenvalues.

template<typename MatrixType >
bool ComplexSchur< MatrixType >::subdiagonalEntryIsNeglegible ( Index  i) [inline, private]

If m_matT(i+1,i) is neglegible in floating point arithmetic compared to m_matT(i,i) and m_matT(j,j), then set it to zero and return true, else return false.

Definition at line 274 of file Eigenvalues.

template<typename _MatrixType>
bool Eigen::ComplexSchur< _MatrixType >::subdiagonalEntryIsNeglegible ( Index  i) [private]

Friends And Related Function Documentation

template<typename _MatrixType>
friend struct internal::complex_schur_reduce_to_hessenberg< MatrixType, NumTraits< Scalar >::IsComplex > [friend]

Definition at line 227 of file Eigenvalues.


Member Data Documentation

template<typename _MatrixType>
HessenbergDecomposition< MatrixType > ComplexSchur< _MatrixType >::m_hess [protected]

Definition at line 218 of file Eigenvalues.

template<typename _MatrixType>
ComputationInfo ComplexSchur< _MatrixType >::m_info [protected]

Definition at line 219 of file Eigenvalues.

template<typename _MatrixType>
bool ComplexSchur< _MatrixType >::m_isInitialized [protected]

Definition at line 220 of file Eigenvalues.

template<typename _MatrixType>
ComplexMatrixType ComplexSchur< _MatrixType >::m_matT [protected]

Definition at line 217 of file Eigenvalues.

template<typename _MatrixType>
ComplexMatrixType ComplexSchur< _MatrixType >::m_matU [protected]

Definition at line 217 of file Eigenvalues.

template<typename _MatrixType>
bool ComplexSchur< _MatrixType >::m_matUisUptodate [protected]

Definition at line 221 of file Eigenvalues.

template<typename _MatrixType>
static const int ComplexSchur< _MatrixType >::m_maxIterations = 30 [static]

Maximum number of iterations.

Maximum number of iterations allowed for an eigenvalue to converge.

Definition at line 214 of file Eigenvalues.




Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN: at Sat Mar 26 06:40:17 UTC 2011