mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 09:39:34 +08:00
Update HouseholderSequence.h
This commit is contained in:
parent
fc1d888415
commit
a4bb513b99
@ -87,7 +87,7 @@ void make_block_householder_triangular_factor(TriangularFactorType& triFactor, c
|
||||
template<typename MatrixType,typename VectorsType,typename CoeffsType>
|
||||
void apply_block_householder_on_the_left(MatrixType& mat, const VectorsType& vectors, const CoeffsType& hCoeffs, bool forward)
|
||||
{
|
||||
enum { TFactorSize = MatrixType::ColsAtCompileTime };
|
||||
enum { TFactorSize = VectorsType::ColsAtCompileTime };
|
||||
Index nbVecs = vectors.cols();
|
||||
Matrix<typename MatrixType::Scalar, TFactorSize, TFactorSize, RowMajor> T(nbVecs,nbVecs);
|
||||
|
||||
|
@ -391,14 +391,18 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
||||
Side==OnTheRight ? m_vectors.cols()-start : bs);
|
||||
std::conditional_t<Side==OnTheRight, Transpose<SubVectorsType>, SubVectorsType&> sub_vecs(sub_vecs1);
|
||||
|
||||
Index dstStart = dst.rows()-rows()+m_shift+k;
|
||||
Index dstRows = rows()-m_shift-k;
|
||||
Block<Dest,Dynamic,Dynamic> sub_dst(dst,
|
||||
dstStart,
|
||||
inputIsIdentity ? dstStart : 0,
|
||||
dstRows,
|
||||
inputIsIdentity ? dstRows : dst.cols());
|
||||
apply_block_householder_on_the_left(sub_dst, sub_vecs, m_coeffs.segment(k, bs), !m_reverse);
|
||||
|
||||
if (inputIsIdentity)
|
||||
{
|
||||
Block<Dest, Dynamic, Dynamic> sub_dst = dst.bottomRightCorner(dstRows, dstRows);
|
||||
apply_block_householder_on_the_left(sub_dst, sub_vecs, m_coeffs.segment(k, bs), !m_reverse);
|
||||
}
|
||||
else
|
||||
{
|
||||
Block<Dest, Dynamic, Dest::ColsAtCompileTime> sub_dst = dst.bottomRows(dstRows);
|
||||
apply_block_householder_on_the_left(sub_dst, sub_vecs, m_coeffs.segment(k, bs), !m_reverse);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -407,9 +411,18 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
||||
for(Index k = 0; k < m_length; ++k)
|
||||
{
|
||||
Index actual_k = m_reverse ? k : m_length-k-1;
|
||||
Index dstStart = rows()-m_shift-actual_k;
|
||||
dst.template bottomRightCorner<Dynamic, Dest::ColsAtCompileTime>(dstStart, inputIsIdentity ? dstStart : dst.cols())
|
||||
.applyHouseholderOnTheLeft(essentialVector(actual_k), m_coeffs.coeff(actual_k), workspace.data());
|
||||
Index dstRows = rows()-m_shift-actual_k;
|
||||
|
||||
if (inputIsIdentity)
|
||||
{
|
||||
Block<Dest, Dynamic, Dynamic> sub_dst = dst.bottomRightCorner(dstRows, dstRows);
|
||||
sub_dst.applyHouseholderOnTheLeft(essentialVector(actual_k), m_coeffs.coeff(actual_k), workspace.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
Block<Dest, Dynamic, Dest::ColsAtCompileTime> sub_dst = dst.bottomRows(dstRows);
|
||||
sub_dst.applyHouseholderOnTheLeft(essentialVector(actual_k), m_coeffs.coeff(actual_k), workspace.data());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user