mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* HouseholderSequence:
* be aware of number of actual householder vectors
(optimization in non-full-rank case, no behavior change)
* fix applyThisOnTheRight, it was using k instead of actual_k
* QR: rename matrixQ() to householderQ() where applicable
This commit is contained in:
@@ -105,7 +105,7 @@ template<typename _MatrixType> class ColPivHouseholderQR
|
||||
return ei_solve_retval<ColPivHouseholderQR, Rhs>(*this, b.derived());
|
||||
}
|
||||
|
||||
HouseholderSequenceType matrixQ(void) const;
|
||||
HouseholderSequenceType householderQ(void) const;
|
||||
|
||||
/** \returns a reference to the matrix where the Householder QR decomposition is stored
|
||||
*/
|
||||
@@ -447,7 +447,8 @@ struct ei_solve_retval<ColPivHouseholderQR<_MatrixType>, Rhs>
|
||||
c.applyOnTheLeft(householderSequence(
|
||||
dec().matrixQR(),
|
||||
dec().hCoeffs(),
|
||||
true
|
||||
true,
|
||||
dec().nonzeroPivots()
|
||||
));
|
||||
|
||||
dec().matrixQR()
|
||||
@@ -470,10 +471,11 @@ struct ei_solve_retval<ColPivHouseholderQR<_MatrixType>, Rhs>
|
||||
|
||||
/** \returns the matrix Q as a sequence of householder transformations */
|
||||
template<typename MatrixType>
|
||||
typename ColPivHouseholderQR<MatrixType>::HouseholderSequenceType ColPivHouseholderQR<MatrixType>::matrixQ() const
|
||||
typename ColPivHouseholderQR<MatrixType>::HouseholderSequenceType ColPivHouseholderQR<MatrixType>
|
||||
::householderQ() const
|
||||
{
|
||||
ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized.");
|
||||
return HouseholderSequenceType(m_qr, m_hCoeffs.conjugate(), false);
|
||||
return HouseholderSequenceType(m_qr, m_hCoeffs.conjugate(), false, m_nonzero_pivots);
|
||||
}
|
||||
|
||||
#endif // EIGEN_HIDE_HEAVY_CODE
|
||||
|
||||
@@ -104,11 +104,10 @@ template<typename _MatrixType> class HouseholderQR
|
||||
ei_assert(m_isInitialized && "HouseholderQR is not initialized.");
|
||||
return ei_solve_retval<HouseholderQR, Rhs>(*this, b.derived());
|
||||
}
|
||||
|
||||
MatrixQType matrixQ() const;
|
||||
|
||||
HouseholderSequenceType matrixQAsHouseholderSequence() const
|
||||
HouseholderSequenceType householderQ() const
|
||||
{
|
||||
ei_assert(m_isInitialized && "HouseholderQR is not initialized.");
|
||||
return HouseholderSequenceType(m_qr, m_hCoeffs.conjugate());
|
||||
}
|
||||
|
||||
@@ -240,14 +239,6 @@ struct ei_solve_retval<HouseholderQR<_MatrixType>, Rhs>
|
||||
}
|
||||
};
|
||||
|
||||
/** \returns the matrix Q */
|
||||
template<typename MatrixType>
|
||||
typename HouseholderQR<MatrixType>::MatrixQType HouseholderQR<MatrixType>::matrixQ() const
|
||||
{
|
||||
ei_assert(m_isInitialized && "HouseholderQR is not initialized.");
|
||||
return matrixQAsHouseholderSequence();
|
||||
}
|
||||
|
||||
#endif // EIGEN_HIDE_HEAVY_CODE
|
||||
|
||||
/** \return the Householder QR decomposition of \c *this.
|
||||
|
||||
Reference in New Issue
Block a user