From 82ec250a0f9abc11be71e8d0f92dc6f7284b91d0 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 7 Jan 2010 12:50:02 -0500 Subject: [PATCH] make applyHouseholderOnTheRight take a row vector, not a column vector: this is how it's used in practice. --- Eigen/src/Householder/Householder.h | 4 ++-- test/householder.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Householder/Householder.h b/Eigen/src/Householder/Householder.h index 1e549633a..4b97dfee1 100644 --- a/Eigen/src/Householder/Householder.h +++ b/Eigen/src/Householder/Householder.h @@ -116,10 +116,10 @@ void MatrixBase::applyHouseholderOnTheRight( { Map > tmp(workspace,rows()); Block right(derived(), 0, 1, rows(), cols()-1); - tmp.noalias() = right * essential.conjugate(); + tmp.noalias() = right * essential.adjoint(); tmp += this->col(0); this->col(0) -= tau * tmp; - right.noalias() -= tau * tmp * essential.transpose(); + right.noalias() -= tau * tmp * essential; } #endif // EIGEN_HOUSEHOLDER_H diff --git a/test/householder.cpp b/test/householder.cpp index 4e4c78863..85492cdff 100644 --- a/test/householder.cpp +++ b/test/householder.cpp @@ -79,7 +79,7 @@ template void householder(const MatrixType& m) m3.rowwise() = v1.transpose(); m4 = m3; m3.row(0).makeHouseholder(essential, beta, alpha); - m3.applyHouseholderOnTheRight(essential,beta,tmp); + m3.applyHouseholderOnTheRight(essential.transpose(),beta,tmp); VERIFY_IS_APPROX(m3.norm(), m4.norm()); VERIFY_IS_MUCH_SMALLER_THAN(m3.block(0,1,rows,rows-1).norm(), m3.norm()); VERIFY_IS_MUCH_SMALLER_THAN(ei_imag(m3(0,0)), ei_real(m3(0,0)));