Class xlifepp::HouseholderQR#
-
template<typename _MatrixType>
class HouseholderQR#
-
Collaboration diagram for xlifepp::HouseholderQR:
Householder QR decomposition of a matrix.
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.
- Param MatrixType:
-
the type of the matrix of which we are computing the QR decomposition
Public Functions
-
inline HouseholderQR()#
-
Default Constructor.
The default constructor is useful in cases in which the user intends to perform decompositions via HouseholderQR::compute(const MatrixType&).
-
inline HouseholderQR(const MatrixType &matrix)#
-
constructor by type of matrix
-
inline HouseholderQR(Index rows, Index cols)#
-
Default Constructor with memory preallocation.
Like the default constructor but with preallocation of the internalEigenSolver data according to the specified problem size.
See also
-
MatrixType::RealScalar absDeterminant() const#
-
See also
logAbsDeterminant(), MatrixBase::determinant()
- 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.
-
MatrixType::RealScalar logAbsDeterminant() const#
-
See also
absDeterminant(), MatrixBase::determinant()
- 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.
Note
This method is useful to work around the risk of overflow/underflow that’s inherent to determinant computation.
-
inline const MatrixType &matrixQR() const#
-
- Returns:
-
a reference to the matrix where the Householder QR decomposition is stored in a LAPACK-compatible way.