QR< MatrixType > Class Template Reference

QR decomposition of a matrix. More...

#include <QR.h>

List of all members.

Public Types

typedef Block< MatrixType,
MatrixType::ColsAtCompileTime,
MatrixType::ColsAtCompileTime > 
MatrixRBlockType
typedef Matrix< Scalar,
MatrixType::ColsAtCompileTime,
MatrixType::ColsAtCompileTime > 
MatrixTypeR
typedef MatrixType::RealScalar RealScalar
typedef MatrixType::Scalar Scalar
typedef Matrix< Scalar,
MatrixType::ColsAtCompileTime, 1 > 
VectorType

Public Member Functions

void compute (const MatrixType &matrix)
int dimensionOfKernel () const
EIGEN_DEPRECATED bool isFullRank () const
bool isInjective () const
bool isInvertible () const
bool isSurjective () const
MatrixType matrixQ (void) const
const Part< NestByValue
< MatrixRBlockType >
, UpperTriangular
matrixR (void) const
 QR (const MatrixType &matrix)
 QR ()
 Default Constructor.
int rank () const
template<typename OtherDerived , typename ResultType >
bool solve (const MatrixBase< OtherDerived > &b, ResultType *result) const

Protected Attributes

VectorType m_hCoeffs
bool m_isInitialized
MatrixType m_qr
int m_rank
bool m_rankIsUptodate

Detailed Description

template<typename MatrixType>
class QR< MatrixType >

QR decomposition of a matrix.

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

This class performs a QR decomposition using Householder transformations. The result is stored in a compact way compatible with LAPACK.

See also:
MatrixBase::qr()

Definition at line 42 of file QR.h.


Member Typedef Documentation

template<typename MatrixType>
typedef Block<MatrixType, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> QR< MatrixType >::MatrixRBlockType

Definition at line 48 of file QR.h.

template<typename MatrixType>
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> QR< MatrixType >::MatrixTypeR

Definition at line 49 of file QR.h.

template<typename MatrixType>
typedef MatrixType::RealScalar QR< MatrixType >::RealScalar

Definition at line 47 of file QR.h.

template<typename MatrixType>
typedef MatrixType::Scalar QR< MatrixType >::Scalar

Definition at line 46 of file QR.h.

template<typename MatrixType>
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> QR< MatrixType >::VectorType

Definition at line 50 of file QR.h.


Constructor & Destructor Documentation

template<typename MatrixType>
QR< MatrixType >::QR (  )  [inline]

Default Constructor.

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

Definition at line 58 of file QR.h.

template<typename MatrixType>
QR< MatrixType >::QR ( const MatrixType &  matrix  )  [inline]

Definition at line 60 of file QR.h.


Member Function Documentation

template<typename MatrixType >
void QR< MatrixType >::compute ( const MatrixType &  matrix  )  [inline]

Definition at line 200 of file QR.h.

template<typename MatrixType>
int QR< MatrixType >::dimensionOfKernel (  )  const [inline]
Returns:
the dimension of the kernel of the matrix of which *this is the QR decomposition.
Note:
Since the rank is computed only once, i.e. the first time it is needed, this method almost does not perform any further computation.

Definition at line 92 of file QR.h.

template<typename MatrixType>
EIGEN_DEPRECATED bool QR< MatrixType >::isFullRank (  )  const [inline]
Deprecated:
use isInjective()
Returns:
whether or not the matrix is of full rank
Note:
Since the rank is computed only once, i.e. the first time it is needed, this method almost does not perform any further computation.

Definition at line 74 of file QR.h.

template<typename MatrixType>
bool QR< MatrixType >::isInjective (  )  const [inline]
Returns:
true if the matrix of which *this is the QR decomposition represents an injective linear map, i.e. has trivial kernel; false otherwise.
Note:
Since the rank is computed only once, i.e. the first time it is needed, this method almost does not perform any further computation.

Definition at line 104 of file QR.h.

template<typename MatrixType>
bool QR< MatrixType >::isInvertible (  )  const [inline]
Returns:
true if the matrix of which *this is the QR decomposition is invertible.
Note:
Since the rank is computed only once, i.e. the first time it is needed, this method almost does not perform any further computation.

Definition at line 127 of file QR.h.

template<typename MatrixType>
bool QR< MatrixType >::isSurjective (  )  const [inline]
Returns:
true if the matrix of which *this is the QR decomposition represents a surjective linear map; false otherwise.
Note:
Since the rank is computed only once, i.e. the first time it is needed, this method almost does not perform any further computation.

Definition at line 116 of file QR.h.

template<typename MatrixType >
MatrixType QR< MatrixType >::matrixQ ( void   )  const [inline]
Returns:
the matrix Q

Definition at line 303 of file QR.h.

template<typename MatrixType>
const Part<NestByValue<MatrixRBlockType>, UpperTriangular> QR< MatrixType >::matrixR ( void   )  const [inline]
Returns:
a read-only expression of the matrix R of the actual the QR decomposition

Definition at line 135 of file QR.h.

template<typename MatrixType >
int QR< MatrixType >::rank (  )  const [inline]
Returns:
the rank of the matrix of which *this is the QR decomposition.
Note:
Since the rank is computed only once, i.e. the first time it is needed, this method almost does not perform any further computation.
Returns:
the rank of the matrix of which *this is the QR decomposition.

Definition at line 182 of file QR.h.

template<typename MatrixType >
template<typename OtherDerived , typename ResultType >
bool QR< MatrixType >::solve ( const MatrixBase< OtherDerived > &  b,
ResultType *  result 
) 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:
b the right-hand-side of the equation to solve.
result a pointer to the vector/matrix in which to store the solution, if any exists. Resized if necessary, so that result->rows()==A.cols() and result->cols()==b.cols(). If no solution exists, *result is left with undefined coefficients.
Returns:
true if any solution exists, false if no solution exists.
Note:
If there exist more than one solution, this method will arbitrarily choose one. If you need a complete analysis of the space of solutions, take the one solution obtained by this method and add to it elements of the kernel, as determined by kernel().
The case where b is a matrix is not yet implemented. Also, this code is space inefficient.

Example:

Output:

See also:
MatrixBase::solveTriangular(), kernel(), computeKernel(), inverse(), computeInverse()

Definition at line 265 of file QR.h.


Member Data Documentation

template<typename MatrixType>
VectorType QR< MatrixType >::m_hCoeffs [protected]

Definition at line 174 of file QR.h.

template<typename MatrixType>
bool QR< MatrixType >::m_isInitialized [protected]

Definition at line 177 of file QR.h.

template<typename MatrixType>
MatrixType QR< MatrixType >::m_qr [protected]

Definition at line 173 of file QR.h.

template<typename MatrixType>
int QR< MatrixType >::m_rank [mutable, protected]

Definition at line 175 of file QR.h.

template<typename MatrixType>
bool QR< MatrixType >::m_rankIsUptodate [mutable, protected]

Definition at line 176 of file QR.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


vcglib
Author(s): Christian Bersch
autogenerated on Fri Jan 11 09:22:19 2013