Main MRPT website > C++ reference
MRPT logo
Public Types | Public Member Functions | Protected Attributes
Eigen::HouseholderQR Class Reference

Detailed Description

Householder QR decomposition of a matrix.

Parameters:
MatrixTypethe type of the matrix of which we are computing the QR decomposition

This class performs a QR decomposition of a matrix A into matrices Q and R such that

\[ \mathbf{A} = \mathbf{Q} \, \mathbf{R} \]

by using Householder transformations. Here, Q a unitary matrix and R an upper triangular matrix. The result is stored in a compact way compatible with LAPACK.

Note that no pivoting is performed. This is not a rank-revealing decomposition. If you want that feature, use FullPivHouseholderQR or ColPivHouseholderQR instead.

This Householder QR decomposition is faster, but less numerically stable and less feature-full than FullPivHouseholderQR or ColPivHouseholderQR.

See also:
MatrixBase::householderQr()

List of all members.

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
typedef MatrixType::RealScalar RealScalar
typedef MatrixType::Index Index
typedef Matrix< Scalar,
RowsAtCompileTime,
RowsAtCompileTime,(MatrixType::Flags
&RowMajorBit)?RowMajor:ColMajor,
MaxRowsAtCompileTime,
MaxRowsAtCompileTime > 
MatrixQType
typedef
internal::plain_diag_type
< MatrixType >::type 
HCoeffsType
typedef
internal::plain_row_type
< MatrixType >::type 
RowVectorType
typedef HouseholderSequence
< MatrixType, HCoeffsType >
::ConjugateReturnType 
HouseholderSequenceType

Public Member Functions

 HouseholderQR ()
 Default Constructor.
 HouseholderQR (Index rows, Index cols)
 Default Constructor with memory preallocation.
 HouseholderQR (const MatrixType &matrix)
template<typename Rhs >
const internal::solve_retval
< HouseholderQR, Rhs > 
solve (const MatrixBase< Rhs > &b) const
 This method finds a solution x to the equation Ax=b, where A is the matrix of which *this is the QR decomposition, if any exists.
HouseholderSequenceType householderQ () const
const MatrixTypematrixQR () const
HouseholderQRcompute (const MatrixType &matrix)
MatrixType::RealScalar absDeterminant () const
MatrixType::RealScalar logAbsDeterminant () const
Index rows () const
Index cols () const
const HCoeffsTypehCoeffs () const

Protected Attributes

MatrixType m_qr
HCoeffsType m_hCoeffs
RowVectorType m_temp
bool m_isInitialized

Member Typedef Documentation

Definition at line 72 of file QR.

Definition at line 74 of file QR.

typedef MatrixType::Index Eigen::HouseholderQR::Index

Definition at line 70 of file QR.

typedef Matrix<Scalar, RowsAtCompileTime, RowsAtCompileTime, (MatrixType::Flags&RowMajorBit) ? RowMajor : ColMajor, MaxRowsAtCompileTime, MaxRowsAtCompileTime> Eigen::HouseholderQR::MatrixQType

Definition at line 71 of file QR.

typedef _MatrixType Eigen::HouseholderQR::MatrixType

Definition at line 60 of file QR.

typedef MatrixType::RealScalar Eigen::HouseholderQR::RealScalar

Definition at line 69 of file QR.

Definition at line 73 of file QR.

typedef MatrixType::Scalar Eigen::HouseholderQR::Scalar

Definition at line 68 of file QR.


Member Enumeration Documentation

anonymous enum
Enumerator:
RowsAtCompileTime 
ColsAtCompileTime 
Options 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 

Definition at line 61 of file QR.


Constructor & Destructor Documentation

Eigen::HouseholderQR::HouseholderQR ( ) [inline]

Default Constructor.

The default constructor is useful in cases in which the user intends to perform decompositions via HouseholderQR::compute(const MatrixType&).

Definition at line 82 of file QR.

Eigen::HouseholderQR::HouseholderQR ( Index  rows,
Index  cols 
) [inline]

Default Constructor with memory preallocation.

Like the default constructor but with preallocation of the internal data according to the specified problem size.

See also:
HouseholderQR()

Definition at line 90 of file QR.

Eigen::HouseholderQR::HouseholderQR ( const MatrixType matrix) [inline]

Definition at line 96 of file QR.


Member Function Documentation

MatrixType::RealScalar Eigen::HouseholderQR::absDeterminant ( ) const
Returns:
the absolute value of the determinant of the matrix of which *this is the QR decomposition. It has only linear complexity (that is, O(n) where n is the dimension of the square matrix) as the QR decomposition has already been computed.
Note:
This is only for square matrices.
Warning:
a determinant can be very big or small, so for matrices of large enough dimension, there is a risk of overflow/underflow. One way to work around that is to use logAbsDeterminant() instead.
See also:
logAbsDeterminant(), MatrixBase::determinant()

Definition at line 188 of file QR.

Index Eigen::HouseholderQR::cols ( void  ) const [inline]

Definition at line 177 of file QR.

HouseholderQR< MatrixType > & Eigen::HouseholderQR::compute ( const MatrixType matrix)

Definition at line 327 of file QR.

const HCoeffsType& Eigen::HouseholderQR::hCoeffs ( ) const [inline]

Definition at line 178 of file QR.

HouseholderSequenceType Eigen::HouseholderQR::householderQ ( ) const [inline]

Definition at line 130 of file QR.

MatrixType::RealScalar Eigen::HouseholderQR::logAbsDeterminant ( ) const
Returns:
the natural log of the absolute value of the determinant of the matrix of which *this is the QR decomposition. It has only linear complexity (that is, O(n) where n is the dimension of the square matrix) as the QR decomposition has already been computed.
Note:
This is only for square matrices.
This method is useful to work around the risk of overflow/underflow that's inherent to determinant computation.
See also:
absDeterminant(), MatrixBase::determinant()

Definition at line 196 of file QR.

const MatrixType& Eigen::HouseholderQR::matrixQR ( ) const [inline]
Returns:
a reference to the matrix where the Householder QR decomposition is stored in a LAPACK-compatible way.

Definition at line 139 of file QR.

Index Eigen::HouseholderQR::rows ( void  ) const [inline]

Definition at line 176 of file QR.

template<typename Rhs >
const internal::solve_retval<HouseholderQR, Rhs> Eigen::HouseholderQR::solve ( const MatrixBase< Rhs > &  b) const [inline]

This method finds a solution x to the equation Ax=b, where A is the matrix of which *this is the QR decomposition, if any exists.

Parameters:
bthe right-hand-side of the equation to solve.
Returns:
a solution.
Note:
The case where b is a matrix is not yet implemented. Also, this code is space inefficient.

Example:

Output:

Definition at line 124 of file QR.


Member Data Documentation

Definition at line 182 of file QR.

Definition at line 184 of file QR.

Definition at line 181 of file QR.

Definition at line 183 of file QR.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011