mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-22 01:29:35 +08:00
Fallback to lazy products for very small ones.
This commit is contained in:
parent
de8336a9bc
commit
d936ddc3d1
@ -387,6 +387,36 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
|
||||
EIGEN_CHECK_BINARY_COMPATIBILIY(BinOp,LhsScalar,RhsScalar);
|
||||
}
|
||||
|
||||
template<typename Dest>
|
||||
inline void evalTo(Dest& dst) const
|
||||
{
|
||||
if((m_rhs.rows()+dst.rows()+dst.cols())<20)
|
||||
dst.noalias() = m_lhs .lazyProduct( m_rhs );
|
||||
else
|
||||
{
|
||||
dst.setZero();
|
||||
scaleAndAddTo(dst,Scalar(1));
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Dest>
|
||||
inline void addTo(Dest& dst) const
|
||||
{
|
||||
if((m_rhs.rows()+dst.rows()+dst.cols())<20)
|
||||
dst.noalias() += m_lhs .lazyProduct( m_rhs );
|
||||
else
|
||||
scaleAndAddTo(dst,Scalar(1));
|
||||
}
|
||||
|
||||
template<typename Dest>
|
||||
inline void subTo(Dest& dst) const
|
||||
{
|
||||
if((m_rhs.rows()+dst.rows()+dst.cols())<20)
|
||||
dst.noalias() -= m_lhs .lazyProduct( m_rhs );
|
||||
else
|
||||
scaleAndAddTo(dst,Scalar(-1));
|
||||
}
|
||||
|
||||
template<typename Dest> void scaleAndAddTo(Dest& dst, const Scalar& alpha) const
|
||||
{
|
||||
eigen_assert(dst.rows()==m_lhs.rows() && dst.cols()==m_rhs.cols());
|
||||
|
Loading…
x
Reference in New Issue
Block a user