make applyHouseholderOnTheRight take a row vector, not a column vector:

this is how it's used in practice.
This commit is contained in:
Benoit Jacob 2010-01-07 12:50:02 -05:00
parent c24de5b413
commit 82ec250a0f
2 changed files with 3 additions and 3 deletions

View File

@ -116,10 +116,10 @@ void MatrixBase<Derived>::applyHouseholderOnTheRight(
{
Map<Matrix<Scalar, RowsAtCompileTime, 1, PlainMatrixType::Options, MaxRowsAtCompileTime, 1> > tmp(workspace,rows());
Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> 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

View File

@ -79,7 +79,7 @@ template<typename MatrixType> 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)));