Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType > Class Template Reference

This class is a modification of Eigen's ColPivHouseholdeQR to perform a rank-revealing QR with column pivoting MP = QR with R*P' directly stored in the input matrix M and the householder vectors essential parts stored in the column of a different matrix given by the user. More...

#include <DestructiveColPivQR.hpp>

List of all members.

Public Types

enum  {
  RowsAtCompileTime = MatrixType::RowsAtCompileTime,
  ColsAtCompileTime = MatrixType::ColsAtCompileTime,
  MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
  MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
}
typedef _MatrixType MatrixType
typedef MatrixType::Scalar Scalar
typedef MatrixType::RealScalar RealScalar
typedef MatrixType::Index Index
typedef _HouseholderStorageType MatrixQType
typedef Diagonal< MatrixQType, 0 > HCoeffsType
typedef PermutationMatrix
< ColsAtCompileTime,
MaxColsAtCompileTime, typename
MatrixType::Index > 
PermutationType
typedef
internal::plain_row_type
< MatrixType, Index >::type 
IntRowVectorType
typedef
internal::plain_row_type
< MatrixType >::type 
RowVectorType
typedef
internal::plain_row_type
< MatrixType, RealScalar >
::type 
RealRowVectorType
typedef HouseholderSequence
< MatrixQType, HCoeffsType >
::ConjugateReturnType 
HouseholderSequenceType

Public Member Functions

 DestructiveColPivQR (MatrixType &matrix, MatrixQType &householderEssentialStorage, RealScalar epsilon=0.)
HouseholderSequenceType householderQ (void) const
const MatrixTypematrixR () const
DestructiveColPivQRcompute (MatrixType &matrix, MatrixQType &householderEssentialStorage)
DestructiveColPivQRcompute ()
const PermutationTypecolsPermutation () const
MatrixType::RealScalar absDeterminant () const
MatrixType::RealScalar logAbsDeterminant () const
Index rank () const
Index dimensionOfKernel () const
bool isInjective () const
bool isSurjective () const
bool isInvertible () const
Index rows () const
Index cols () const
const HCoeffsTypehCoeffs () const
DestructiveColPivQRsetEpsilon (const RealScalar &epsilon)
 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.
DestructiveColPivQRsetEpsilon (Default_t)
 Allows to come back to the default behavior, letting Eigen use its default formula for determining the threshold.
RealScalar epsilon () const
 Returns the threshold that will be used by certain methods such as rank().
Index nonzeroPivots () const
RealScalar maxPivot () const

Protected Attributes

MatrixTypem_r
MatrixQTypem_q
HCoeffsType m_hCoeffs
PermutationType m_colsPermutation
IntRowVectorType m_colsTranspositions
IntRowVectorType m_colsIntTranspositions
RowVectorType m_temp
RealRowVectorType m_colSqNorms
bool m_isInitialized
bool m_usePrescribedEpsilon
RealScalar m_prescribedEpsilon
RealScalar m_maxpivot
Index m_nonzero_pivots
Index m_det_pq

Detailed Description

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
class Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >

This class is a modification of Eigen's ColPivHouseholdeQR to perform a rank-revealing QR with column pivoting MP = QR with R*P' directly stored in the input matrix M and the householder vectors essential parts stored in the column of a different matrix given by the user.


Member Typedef Documentation

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef Diagonal<MatrixQType,0> Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::HCoeffsType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef HouseholderSequence<MatrixQType,HCoeffsType>::ConjugateReturnType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::HouseholderSequenceType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef MatrixType::Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::Index
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef internal::plain_row_type<MatrixType, Index>::type Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::IntRowVectorType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef _HouseholderStorageType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::MatrixQType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef _MatrixType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::MatrixType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef PermutationMatrix<ColsAtCompileTime, MaxColsAtCompileTime, typename MatrixType::Index> Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::PermutationType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef internal::plain_row_type<MatrixType, RealScalar>::type Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::RealRowVectorType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef MatrixType::RealScalar Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::RealScalar
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef internal::plain_row_type<MatrixType>::type Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::RowVectorType
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
typedef MatrixType::Scalar Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::Scalar

Member Enumeration Documentation

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
anonymous enum
Enumerator:
RowsAtCompileTime 
ColsAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 

Constructor & Destructor Documentation

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::DestructiveColPivQR ( MatrixType matrix,
MatrixQType householderEssentialStorage,
RealScalar  epsilon = 0. 
) [inline]

Member Function Documentation

template<typename MatrixType , typename HouseholderStrorageType >
MatrixType::RealScalar Eigen::DestructiveColPivQR< MatrixType, HouseholderStrorageType >::absDeterminant ( ) const
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.
See also:
logAbsDeterminant(), MatrixBase::determinant()

References LOCAL_ABS.

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::cols ( ) const [inline]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
const PermutationType& Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::colsPermutation ( ) const [inline]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
DestructiveColPivQR& Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::compute ( MatrixType matrix,
MatrixQType householderEssentialStorage 
) [inline]
template<typename MatrixType , typename HouseholderStrorageType >
DestructiveColPivQR< MatrixType, HouseholderStrorageType > & Eigen::DestructiveColPivQR< MatrixType, HouseholderStrorageType >::compute ( )
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::dimensionOfKernel ( ) const [inline]
Returns:
the dimension of the kernel of the matrix of which *this is the QR decomposition.
Note:
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::cols(), Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_isInitialized, and Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::rank().

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
RealScalar Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::epsilon ( ) const [inline]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
const HCoeffsType& Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::hCoeffs ( ) const [inline]
template<typename MatrixType , typename HouseholderStrorageType >
DestructiveColPivQR< MatrixType, HouseholderStrorageType >::HouseholderSequenceType Eigen::DestructiveColPivQR< MatrixType, HouseholderStrorageType >::householderQ ( void  ) const
Returns:
the matrix Q as a sequence of householder transformations
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
bool Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::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:
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::cols(), Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_isInitialized, and Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::rank().

Referenced by Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::isInvertible().

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
bool Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::isInvertible ( ) const [inline]
Returns:
true if the matrix of which *this is the QR decomposition is invertible.
Note:
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::isInjective(), Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::isSurjective(), and Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_isInitialized.

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
bool Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::isSurjective ( ) const [inline]
Returns:
true if the matrix of which *this is the QR decomposition represents a surjective linear map; false otherwise.
Note:
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_isInitialized, Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::rank(), and Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::rows().

Referenced by Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::isInvertible().

template<typename MatrixType , typename HouseholderStrorageType >
MatrixType::RealScalar Eigen::DestructiveColPivQR< MatrixType, HouseholderStrorageType >::logAbsDeterminant ( ) const
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.
This method is useful to work around the risk of overflow/underflow that's inherent to determinant computation.
See also:
absDeterminant(), MatrixBase::determinant()
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
const MatrixType& Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::matrixR ( ) const [inline]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
RealScalar Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::maxPivot ( ) const [inline]
Returns:
the absolute value of the biggest pivot, i.e. the biggest diagonal coefficient of U.

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_maxpivot.

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::nonzeroPivots ( ) const [inline]
Returns:
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.
See also:
rank()

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_isInitialized, and Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_nonzero_pivots.

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::rank ( ) const [inline]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::rows ( ) const [inline]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
DestructiveColPivQR& Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::setEpsilon ( const RealScalar epsilon) [inline]

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:
thresholdThe new value to use as the threshold.

A pivot will be considered nonzero if its absolute value is strictly greater than \( \vert pivot \vert \leqslant threshold \times \vert maxpivot \vert \) where maxpivot is the biggest pivot.

If you want to come back to the default behavior, call setThreshold(Default_t)

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::epsilon(), Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_prescribedEpsilon, and Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_usePrescribedEpsilon.

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
DestructiveColPivQR& Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::setEpsilon ( Default_t  ) [inline]

Allows to come back to the default behavior, letting Eigen use its default formula for determining the threshold.

You should pass the special object Eigen::Default as parameter here.

 qr.setThreshold(Eigen::Default); 

See the documentation of setThreshold(const RealScalar&).

References Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_usePrescribedEpsilon.


Member Data Documentation

template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
IntRowVectorType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_colsIntTranspositions [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
PermutationType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_colsPermutation [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
RealRowVectorType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_colSqNorms [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
IntRowVectorType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_colsTranspositions [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_det_pq [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
HCoeffsType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_hCoeffs [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
RealScalar Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_maxpivot [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
Index Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_nonzero_pivots [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
RealScalar Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_prescribedEpsilon [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
MatrixQType& Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_q [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
RowVectorType Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_temp [protected]
template<typename _MatrixType, typename _HouseholderStorageType = typename internal::plain_matrix_type<_MatrixType>::type>
bool Eigen::DestructiveColPivQR< _MatrixType, _HouseholderStorageType >::m_usePrescribedEpsilon [protected]