diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-09-16 15:56:20 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-09-16 15:56:20 +0200 |
commit | 24950bdfcb60830bc615220f993c12082dd42059 (patch) | |
tree | f4e3321a8a7461f239320ee27d3c7f559d6206c9 /Eigen/src/Householder | |
parent | 49dd5d7847e4439f30de37de8372c9483b63b425 (diff) |
make ColPivotingQR use HouseholderSequence
Diffstat (limited to 'Eigen/src/Householder')
-rw-r--r-- | Eigen/src/Householder/HouseholderSequence.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/Eigen/src/Householder/HouseholderSequence.h b/Eigen/src/Householder/HouseholderSequence.h index 86395213b..16e362814 100644 --- a/Eigen/src/Householder/HouseholderSequence.h +++ b/Eigen/src/Householder/HouseholderSequence.h @@ -80,10 +80,10 @@ template<typename VectorsType, typename CoeffsType> class HouseholderSequence int cols() const { return m_vectors.rows(); } HouseholderSequence transpose() const - { return HouseholderSequence(m_vectors, m_coeffs, !m_trans); } + { return HouseholderSequence(m_vectors, m_coeffs, !m_trans); } ConjugateReturnType conjugate() const - { return ConjugateReturnType(m_vectors, m_coeffs.conjugate(), m_trans); } + { return ConjugateReturnType(m_vectors, m_coeffs.conjugate(), m_trans); } ConjugateReturnType adjoint() const { return ConjugateReturnType(m_vectors, m_coeffs.conjugate(), !m_trans); } @@ -136,6 +136,22 @@ template<typename VectorsType, typename CoeffsType> class HouseholderSequence } } + template<typename OtherDerived> + typename OtherDerived::PlainMatrixType operator*(const MatrixBase<OtherDerived>& other) const + { + typename OtherDerived::PlainMatrixType res(other); + applyThisOnTheLeft(res); + return res; + } + + template<typename OtherDerived> friend + typename OtherDerived::PlainMatrixType operator*(const MatrixBase<OtherDerived>& other, const HouseholderSequence& h) + { + typename OtherDerived::PlainMatrixType res(other); + h.applyThisOnTheRight(res); + return res; + } + protected: typename VectorsType::Nested m_vectors; @@ -143,4 +159,10 @@ template<typename VectorsType, typename CoeffsType> class HouseholderSequence bool m_trans; }; +template<typename VectorsType, typename CoeffsType> +HouseholderSequence<VectorsType,CoeffsType> makeHouseholderSequence(const VectorsType& v, const CoeffsType& h, bool trans=false) +{ + return HouseholderSequence<VectorsType,CoeffsType>(v, h, trans); +} + #endif // EIGEN_HOUSEHOLDER_SEQUENCE_H |