From d1c48f16061a60d92ab6f4df1e877f20c17d78d0 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Wed, 21 Aug 2013 14:34:48 +0100 Subject: [PATCH] BDCSVD: Use HouseholderSeq directly. --- unsupported/Eigen/src/SVD/BDCSVD.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/unsupported/Eigen/src/SVD/BDCSVD.h b/unsupported/Eigen/src/SVD/BDCSVD.h index 3c41e4e46..d5f0a3f21 100644 --- a/unsupported/Eigen/src/SVD/BDCSVD.h +++ b/unsupported/Eigen/src/SVD/BDCSVD.h @@ -203,7 +203,8 @@ private: void deflation43(Index firstCol, Index shift, Index i, Index size); void deflation44(Index firstColu , Index firstColm, Index firstRowW, Index firstColW, Index i, Index j, Index size); void deflation(Index firstCol, Index lastCol, Index k, Index firstRowW, Index firstColW, Index shift); - void copyUV(MatrixX householderU, MatrixX houseHolderV); + void copyUV(const typename internal::UpperBidiagonalization::HouseholderUSequenceType& householderU, + const typename internal::UpperBidiagonalization::HouseholderVSequenceType& householderV); protected: MatrixXr m_naiveU, m_naiveV; @@ -281,7 +282,7 @@ BDCSVD::compute(const MatrixType& matrix, unsigned int computationOp if (isTranspose) copy = matrix.adjoint(); else copy = matrix; - internal::UpperBidiagonalization bid(copy); + internal::UpperBidiagonalization bid(copy); //**** step 2 Divide m_computed.topRows(this->m_diagSize) = bid.bidiagonal().toDenseMatrix().transpose(); @@ -309,9 +310,10 @@ BDCSVD::compute(const MatrixType& matrix, unsigned int computationOp }// end compute -// TODO: this function should accept householder sequences to save converting them to matrix template -void BDCSVD::copyUV(MatrixX householderU, MatrixX householderV){ +void BDCSVD::copyUV(const typename internal::UpperBidiagonalization::HouseholderUSequenceType& householderU, + const typename internal::UpperBidiagonalization::HouseholderVSequenceType& householderV) +{ // Note exchange of U and V: m_matrixU is set from m_naiveV and vice versa if (this->computeU()){ Index Ucols = this->m_computeThinU ? this->m_nonzeroSingularValues : householderU.cols();