Detailed Description

Householder rank-revealing QR decomposition of a matrix with full pivoting.

Template Parameters

_MatrixType

the type of the matrix of which we are computing the QR decomposition

This class performs a rank-revealing QR decomposition of a matrix A into matrices P, P', Q and R such that

by using Householder transformations. Here, P and P' are permutation matrices, Q a unitary matrix and R an upper triangular matrix.

This decomposition performs a very prudent full pivoting in order to be rank-revealing and achieve optimal numerical stability. The trade-off is that it is slower than HouseholderQR and ColPivHouseholderQR.

Member Function Documentation

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.

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.

the number of nonzero pivots in the QR decomposition. Here nonzero is meant in the exact sense, not in a fuzzy sense. So that notion isn't really intrinsically interesting, but it is still useful when implementing algorithms.

Allows to prescribe a threshold to be used by certain methods, such as rank(), who need to determine when pivots are to be considered nonzero. This is not used for the QR decomposition itself.

When it needs to get the threshold value, Eigen calls threshold(). By default, this uses a formula to automatically determine a reasonable threshold. Once you have called the present method setThreshold(const RealScalar&), your value is used instead.

Parameters

threshold

The new value to use as the threshold.

A pivot will be considered nonzero if its absolute value is strictly greater than where maxpivot is the biggest pivot.

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

Parameters

b

the right-hand-side of the equation to solve.

Returns

the exact or least-square solution if the rank is greater or equal to the number of columns of A, and an arbitrary solution otherwise.

This method just tries to find as good a solution as possible. If you want to check whether a solution exists or if it is accurate, just call this function to get a result and then compute the error of this result, or use MatrixBase::isApprox() directly, for instance like this:

bool a_solution_exists = (A*result).isApprox(b, precision);

This method avoids dividing by zero, so that the non-existence of a solution doesn't by itself mean that you'll get inf or nan values.

If there exists more than one solution, this method will arbitrarily choose one.