QR< MatrixType > Class Template Reference
QR decomposition of a matrix.
More...
#include <QR.h>
List of all members.
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>
Definition at line 49 of file QR.h.
template<typename MatrixType>
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>
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>
- 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>
Definition at line 174 of file QR.h.
template<typename MatrixType>
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>
Definition at line 176 of file QR.h.
The documentation for this class was generated from the following file: