mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-09-18 04:13:14 +08:00
make applyHouseholderOnTheRight take a row vector, not a column vector:
this is how it's used in practice.
This commit is contained in:
parent
c24de5b413
commit
82ec250a0f
@ -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
|
||||
|
@ -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)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user