Eigne Matrix Class Library

Dependents:   Eigen_test Odometry_test AttitudeEstimation_usingTicker MPU9250_Quaternion_Binary_Serial ... more

Embed: (wiki syntax)

« Back to documentation index

RealQZ< _MatrixType > Class Template Reference

RealQZ< _MatrixType > Class Template Reference
[Eigenvalues module]

More...

#include <RealQZ.h>

Public Member Functions

 RealQZ (Index size=RowsAtCompileTime==Dynamic?1:RowsAtCompileTime)
 Default constructor.
 RealQZ (const MatrixType &A, const MatrixType &B, bool computeQZ=true)
 Constructor; computes real QZ decomposition of given matrices.
const MatrixType & matrixQ () const
 Returns matrix Q in the QZ decomposition.
const MatrixType & matrixZ () const
 Returns matrix Z in the QZ decomposition.
const MatrixType & matrixS () const
 Returns matrix S in the QZ decomposition.
const MatrixType & matrixT () const
 Returns matrix S in the QZ decomposition.
RealQZcompute (const MatrixType &A, const MatrixType &B, bool computeQZ=true)
 Computes QZ decomposition of given matrix.
ComputationInfo info () const
 Reports whether previous computation was successful.
Index iterations () const
 Returns number of performed QR-like iterations.
RealQZsetMaxIterations (Index maxIters)
 Sets the maximal number of iterations allowed to converge to one eigenvalue or decouple the problem.

Detailed Description

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

Performs a real QZ decomposition of a pair of square matrices

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

Note:
The implementation is based on the algorithm in "Matrix Computations" by Gene H. Golub and Charles F. Van Loan, and a paper "An algorithm for generalized eigenvalue problems" by C.B.Moler and G.W.Stewart.
See also:
class RealSchur, class ComplexSchur, class EigenSolver, class ComplexEigenSolver

Definition at line 57 of file RealQZ.h.


Constructor & Destructor Documentation

RealQZ ( Index  size = RowsAtCompileTime==Dynamic ? 1 : RowsAtCompileTime )

Default constructor.

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

See also:
compute() for an example.

Definition at line 86 of file RealQZ.h.

RealQZ ( const MatrixType &  A,
const MatrixType &  B,
bool  computeQZ = true 
)

Constructor; computes real QZ decomposition of given matrices.

Parameters:
[in]AMatrix A.
[in]BMatrix B.
[in]computeQZIf false, A and Z are not computed.

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

Definition at line 104 of file RealQZ.h.


Member Function Documentation

RealQZ< MatrixType > & compute ( const MatrixType &  A,
const MatrixType &  B,
bool  computeQZ = true 
)

Computes QZ decomposition of given matrix.

Parameters:
[in]AMatrix A.
[in]BMatrix B.
[in]computeQZIf false, A and Z are not computed.
Returns:
Reference to *this

Definition at line 557 of file RealQZ.h.

ComputationInfo info (  ) const

Reports whether previous computation was successful.

Returns:
Success if computation was succesful, NoConvergence otherwise.

Definition at line 166 of file RealQZ.h.

Index iterations (  ) const

Returns number of performed QR-like iterations.

Definition at line 174 of file RealQZ.h.

const MatrixType& matrixQ (  ) const

Returns matrix Q in the QZ decomposition.

Returns:
A const reference to the matrix Q.

Definition at line 119 of file RealQZ.h.

const MatrixType& matrixS (  ) const

Returns matrix S in the QZ decomposition.

Returns:
A const reference to the matrix S.

Definition at line 139 of file RealQZ.h.

const MatrixType& matrixT (  ) const

Returns matrix S in the QZ decomposition.

Returns:
A const reference to the matrix S.

Definition at line 148 of file RealQZ.h.

const MatrixType& matrixZ (  ) const

Returns matrix Z in the QZ decomposition.

Returns:
A const reference to the matrix Z.

Definition at line 129 of file RealQZ.h.

RealQZ& setMaxIterations ( Index  maxIters )

Sets the maximal number of iterations allowed to converge to one eigenvalue or decouple the problem.

Definition at line 183 of file RealQZ.h.