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

Eigen::RealSchur< _MatrixType > Class Template Reference
[Eigenvalues module]


Detailed Description

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

Performs a real Schur decomposition of a square matrix

Template Parameters:
_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: $ A = U T U^T $ 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, $ 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 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.

Note:
The implementation is adapted from JAMA (public domain). Their code is based on EISPACK.
See also:
class ComplexSchur, class EigenSolver, class ComplexEigenSolver

Definition at line 68 of file Eigenvalues.

Inheritance diagram for Eigen::RealSchur< _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
typedef std::complex< typename
NumTraits< Scalar >::Real > 
ComplexScalar
typedef MatrixType::Index Index
typedef Matrix< ComplexScalar,
ColsAtCompileTime, 1, Options
&~RowMajor,
MaxColsAtCompileTime, 1 > 
EigenvalueType
typedef Matrix< Scalar,
ColsAtCompileTime, 1, Options
&~RowMajor,
MaxColsAtCompileTime, 1 > 
ColumnVectorType
typedef _MatrixType MatrixType
typedef MatrixType::Scalar Scalar
typedef std::complex< typename
NumTraits< Scalar >::Real > 
ComplexScalar
typedef MatrixType::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

 RealSchur (Index size=RowsAtCompileTime==Dynamic?1:RowsAtCompileTime)
 Default constructor.
 RealSchur (const MatrixType &matrix, bool computeU=true)
 Constructor; computes real Schur decomposition of given matrix.
const MatrixTypematrixU () const
 Returns the orthogonal matrix in the Schur decomposition.
const MatrixTypematrixT () const
 Returns the quasi-triangular matrix in the Schur decomposition.
RealSchurcompute (const MatrixType &matrix, bool computeU=true)
 Computes Schur decomposition of given matrix.
ComputationInfo info () const
 Reports whether previous computation was successful.
 RealSchur (Index size=RowsAtCompileTime==Dynamic?1:RowsAtCompileTime)
 Default constructor.
 RealSchur (const MatrixType &matrix, bool computeU=true)
 Constructor; computes real Schur decomposition of given matrix.
const MatrixTypematrixU () const
 Returns the orthogonal matrix in the Schur decomposition.
const MatrixTypematrixT () const
 Returns the quasi-triangular matrix in the Schur decomposition.
RealSchurcompute (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 = 40
 Maximum number of iterations.

Private Types

typedef Matrix< Scalar, 3, 1 > Vector3s
typedef Matrix< Scalar, 3, 1 > Vector3s

Private Member Functions

Scalar computeNormOfT ()
Index findSmallSubdiagEntry (Index iu, Scalar norm)
void splitOffTwoRows (Index iu, bool computeU, Scalar exshift)
void computeShift (Index iu, Index iter, Scalar &exshift, Vector3s &shiftInfo)
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)
Scalar computeNormOfT ()
Index findSmallSubdiagEntry (Index iu, Scalar norm)
void splitOffTwoRows (Index iu, bool computeU, Scalar exshift)
void computeShift (Index iu, Index iter, Scalar &exshift, Vector3s &shiftInfo)
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)

Private Attributes

MatrixType m_matT
MatrixType m_matU
ColumnVectorType m_workspaceVector
HessenbergDecomposition
< MatrixType
m_hess
ComputationInfo m_info
bool m_isInitialized
bool m_matUisUptodate

Member Typedef Documentation

template<typename _MatrixType>
typedef Matrix<Scalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealSchur< _MatrixType >::ColumnVectorType

Definition at line 84 of file Eigenvalues.

template<typename _MatrixType>
typedef Matrix<Scalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealSchur< _MatrixType >::ColumnVectorType

Definition at line 84 of file Eigenvalues.

template<typename _MatrixType>
typedef std::complex<typename NumTraits<Scalar>::Real> Eigen::RealSchur< _MatrixType >::ComplexScalar

Definition at line 80 of file Eigenvalues.

template<typename _MatrixType>
typedef std::complex<typename NumTraits<Scalar>::Real> Eigen::RealSchur< _MatrixType >::ComplexScalar

Definition at line 80 of file Eigenvalues.

template<typename _MatrixType>
typedef Matrix<ComplexScalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealSchur< _MatrixType >::EigenvalueType

Definition at line 83 of file Eigenvalues.

template<typename _MatrixType>
typedef Matrix<ComplexScalar, ColsAtCompileTime, 1, Options & ~RowMajor, MaxColsAtCompileTime, 1> Eigen::RealSchur< _MatrixType >::EigenvalueType

Definition at line 83 of file Eigenvalues.

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

Definition at line 81 of file Eigenvalues.

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

Definition at line 81 of file Eigenvalues.

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

Definition at line 71 of file Eigenvalues.

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

Definition at line 71 of file Eigenvalues.

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

Definition at line 79 of file Eigenvalues.

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

Definition at line 79 of file Eigenvalues.

template<typename _MatrixType>
typedef Matrix<Scalar,3,1> Eigen::RealSchur< _MatrixType >::Vector3s [private]

Definition at line 206 of file Eigenvalues.

template<typename _MatrixType>
typedef Matrix<Scalar,3,1> Eigen::RealSchur< _MatrixType >::Vector3s [private]

Definition at line 206 of file Eigenvalues.


Member Enumeration Documentation

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

Definition at line 72 of file Eigenvalues.

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

Definition at line 72 of file Eigenvalues.


Constructor & Destructor Documentation

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

Default constructor.

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

See also:
compute() for an example.

Definition at line 97 of file Eigenvalues.

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

Constructor; computes real Schur decomposition of given matrix.

Parameters:
[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 116 of file Eigenvalues.

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

Default constructor.

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

See also:
compute() for an example.

Definition at line 97 of file Eigenvalues.

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

Constructor; computes real Schur decomposition of given matrix.

Parameters:
[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 116 of file Eigenvalues.


Member Function Documentation

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

Computes Schur decomposition of given matrix.

Parameters:
[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.
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 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 $25n^3$ flops if computeU is true and $10n^3$ flops if computeU is false.

Example:

Output:

Definition at line 218 of file Eigenvalues.

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

Computes Schur decomposition of given matrix.

Parameters:
[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.
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 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 $25n^3$ flops if computeU is true and $10n^3$ flops if computeU is false.

Example:

Output:

template<typename MatrixType >
MatrixType::Scalar RealSchur< MatrixType >::computeNormOfT (  )  [inline, private]

Definition at line 285 of file Eigenvalues.

template<typename _MatrixType>
Scalar Eigen::RealSchur< _MatrixType >::computeNormOfT (  )  [private]
template<typename MatrixType >
void RealSchur< MatrixType >::computeShift ( Index  iu,
Index  iter,
Scalar exshift,
Vector3s shiftInfo 
) [inline, private]

Definition at line 349 of file Eigenvalues.

template<typename _MatrixType>
void Eigen::RealSchur< _MatrixType >::computeShift ( Index  iu,
Index  iter,
Scalar exshift,
Vector3s shiftInfo 
) [private]
template<typename _MatrixType>
Index Eigen::RealSchur< _MatrixType >::findSmallSubdiagEntry ( Index  iu,
Scalar  norm 
) [private]
template<typename MatrixType >
MatrixType::Index RealSchur< MatrixType >::findSmallSubdiagEntry ( Index  iu,
Scalar  norm 
) [inline, private]

Definition at line 299 of file Eigenvalues.

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

Reports whether previous computation was successful.

Returns:
Success if computation was succesful, NoConvergence otherwise.

Definition at line 184 of file Eigenvalues.

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

Reports whether previous computation was successful.

Returns:
Success if computation was succesful, NoConvergence otherwise.

Definition at line 184 of file Eigenvalues.

template<typename _MatrixType>
void Eigen::RealSchur< _MatrixType >::initFrancisQRStep ( Index  il,
Index  iu,
const Vector3s shiftInfo,
Index im,
Vector3s firstHouseholderVector 
) [private]
template<typename MatrixType >
void RealSchur< MatrixType >::initFrancisQRStep ( Index  il,
Index  iu,
const Vector3s shiftInfo,
Index im,
Vector3s firstHouseholderVector 
) [inline, private]

Definition at line 389 of file Eigenvalues.

template<typename _MatrixType>
const MatrixType& Eigen::RealSchur< _MatrixType >::matrixT (  )  const [inline]

Returns the quasi-triangular matrix in the Schur decomposition.

Returns:
A const reference to the matrix T.
Precondition:
Either the constructor RealSchur(const MatrixType&, bool) or the member function compute(const MatrixType&, bool) has been called before to compute the Schur decomposition of a matrix.
See also:
RealSchur(const MatrixType&, bool) for an example

Definition at line 155 of file Eigenvalues.

template<typename _MatrixType>
const MatrixType& Eigen::RealSchur< _MatrixType >::matrixT (  )  const [inline]

Returns the quasi-triangular matrix in the Schur decomposition.

Returns:
A const reference to the matrix T.
Precondition:
Either the constructor RealSchur(const MatrixType&, bool) or the member function compute(const MatrixType&, bool) has been called before to compute the Schur decomposition of a matrix.
See also:
RealSchur(const MatrixType&, bool) for an example

Definition at line 155 of file Eigenvalues.

template<typename _MatrixType>
const MatrixType& Eigen::RealSchur< _MatrixType >::matrixU (  )  const [inline]

Returns the orthogonal matrix in the Schur decomposition.

Returns:
A const reference to the matrix U.
Precondition:
Either the constructor RealSchur(const MatrixType&, bool) or the member function compute(const MatrixType&, bool) has been called before to compute the Schur decomposition of a matrix, and computeU was set to true (the default value).
See also:
RealSchur(const MatrixType&, bool) for an example

Definition at line 138 of file Eigenvalues.

template<typename _MatrixType>
const MatrixType& Eigen::RealSchur< _MatrixType >::matrixU (  )  const [inline]

Returns the orthogonal matrix in the Schur decomposition.

Returns:
A const reference to the matrix U.
Precondition:
Either the constructor RealSchur(const MatrixType&, bool) or the member function compute(const MatrixType&, bool) has been called before to compute the Schur decomposition of a matrix, and computeU was set to true (the default value).
See also:
RealSchur(const MatrixType&, bool) for an example

Definition at line 138 of file Eigenvalues.

template<typename _MatrixType>
void Eigen::RealSchur< _MatrixType >::performFrancisQRStep ( Index  il,
Index  im,
Index  iu,
bool  computeU,
const Vector3s firstHouseholderVector,
Scalar workspace 
) [private]
template<typename MatrixType >
void RealSchur< MatrixType >::performFrancisQRStep ( Index  il,
Index  im,
Index  iu,
bool  computeU,
const Vector3s firstHouseholderVector,
Scalar workspace 
) [inline, private]

Definition at line 415 of file Eigenvalues.

template<typename _MatrixType>
void Eigen::RealSchur< _MatrixType >::splitOffTwoRows ( Index  iu,
bool  computeU,
Scalar  exshift 
) [private]
template<typename MatrixType >
void RealSchur< MatrixType >::splitOffTwoRows ( Index  iu,
bool  computeU,
Scalar  exshift 
) [inline, private]

Definition at line 316 of file Eigenvalues.


Member Data Documentation

template<typename _MatrixType>
HessenbergDecomposition< MatrixType > RealSchur< _MatrixType >::m_hess [private]

Definition at line 201 of file Eigenvalues.

template<typename _MatrixType>
ComputationInfo RealSchur< _MatrixType >::m_info [private]

Definition at line 202 of file Eigenvalues.

template<typename _MatrixType>
bool RealSchur< _MatrixType >::m_isInitialized [private]

Definition at line 203 of file Eigenvalues.

template<typename _MatrixType>
MatrixType RealSchur< _MatrixType >::m_matT [private]

Definition at line 198 of file Eigenvalues.

template<typename _MatrixType>
MatrixType RealSchur< _MatrixType >::m_matU [private]

Definition at line 199 of file Eigenvalues.

template<typename _MatrixType>
bool RealSchur< _MatrixType >::m_matUisUptodate [private]

Definition at line 204 of file Eigenvalues.

template<typename _MatrixType>
static const int RealSchur< _MatrixType >::m_maxIterations = 40 [static]

Maximum number of iterations.

Maximum number of iterations allowed for an eigenvalue to converge.

Definition at line 194 of file Eigenvalues.

template<typename _MatrixType>
ColumnVectorType RealSchur< _MatrixType >::m_workspaceVector [private]

Definition at line 200 of file Eigenvalues.




Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011