mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix calls to lazy products (lazy product does not like matrices with 0 length)
This commit is contained in:
@@ -390,7 +390,7 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
|
|||||||
template<typename Dest>
|
template<typename Dest>
|
||||||
inline void evalTo(Dest& dst) const
|
inline void evalTo(Dest& dst) const
|
||||||
{
|
{
|
||||||
if((m_rhs.rows()+dst.rows()+dst.cols())<20)
|
if((m_rhs.rows()+dst.rows()+dst.cols())<20 && m_rhs.rows()>0)
|
||||||
dst.noalias() = m_lhs .lazyProduct( m_rhs );
|
dst.noalias() = m_lhs .lazyProduct( m_rhs );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -402,7 +402,7 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
|
|||||||
template<typename Dest>
|
template<typename Dest>
|
||||||
inline void addTo(Dest& dst) const
|
inline void addTo(Dest& dst) const
|
||||||
{
|
{
|
||||||
if((m_rhs.rows()+dst.rows()+dst.cols())<20)
|
if((m_rhs.rows()+dst.rows()+dst.cols())<20 && m_rhs.rows()>0)
|
||||||
dst.noalias() += m_lhs .lazyProduct( m_rhs );
|
dst.noalias() += m_lhs .lazyProduct( m_rhs );
|
||||||
else
|
else
|
||||||
scaleAndAddTo(dst,Scalar(1));
|
scaleAndAddTo(dst,Scalar(1));
|
||||||
@@ -411,7 +411,7 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
|
|||||||
template<typename Dest>
|
template<typename Dest>
|
||||||
inline void subTo(Dest& dst) const
|
inline void subTo(Dest& dst) const
|
||||||
{
|
{
|
||||||
if((m_rhs.rows()+dst.rows()+dst.cols())<20)
|
if((m_rhs.rows()+dst.rows()+dst.cols())<20 && m_rhs.rows()>0)
|
||||||
dst.noalias() -= m_lhs .lazyProduct( m_rhs );
|
dst.noalias() -= m_lhs .lazyProduct( m_rhs );
|
||||||
else
|
else
|
||||||
scaleAndAddTo(dst,Scalar(-1));
|
scaleAndAddTo(dst,Scalar(-1));
|
||||||
|
|||||||
Reference in New Issue
Block a user