Class xlifepp::HouseholderQR#

template<typename _MatrixType>
class HouseholderQR#

Collaboration diagram for xlifepp::HouseholderQR:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="xlifepp::Vector< Scalar >" tooltip="xlifepp::Vector< Scalar >"] "2" [label="xlifepp::VectorEigenDense< Scalar >" tooltip="xlifepp::VectorEigenDense< Scalar >"] "5" [label="std::vector< T >" tooltip="std::vector< T >"] "7" [label="std::vector< K >" tooltip="std::vector< K >"] "4" [label="std::vector< Scalar >" tooltip="std::vector< Scalar >"] "1" [label="xlifepp::HouseholderQR< _MatrixType >" tooltip="xlifepp::HouseholderQR< _MatrixType >" fillcolor="#BFBFBF"] "6" [label="xlifepp::Vector< K >" tooltip="xlifepp::Vector< K >"] "9" [label="xlifepp::Vector< K >" tooltip="xlifepp::Vector< K >"] "8" [label="xlifepp::VectorEigenDense< K >" tooltip="xlifepp::VectorEigenDense< K >"] "3" -> "4" [dir=forward tooltip="public-inheritance"] "3" -> "6" [dir=forward tooltip="template-instance"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "2" -> "8" [dir=forward tooltip="template-instance"] "7" -> "5" [dir=forward tooltip="template-instance"] "4" -> "5" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="usage"] "6" -> "7" [dir=forward tooltip="public-inheritance"] "9" -> "7" [dir=forward tooltip="public-inheritance"] "8" -> "9" [dir=forward tooltip="public-inheritance"] }

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

HouseholderQR()

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.