aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-04-18 17:06:03 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-04-18 17:06:03 +0200
commit3454b4e5f1eb1a68e15415eeca827a30cb3bb58e (patch)
tree33292e7f12be9aa18580e30026989ae690e2cf7c /Eigen
parent94684721bd2d10c0b67ef518ed599981603440bc (diff)
Fix calls to lazy products (lazy product does not like matrices with 0 length)
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/products/GeneralMatrixMatrix.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h
index b45797f09..6ad07eccb 100644
--- a/Eigen/src/Core/products/GeneralMatrixMatrix.h
+++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h
@@ -390,7 +390,7 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
template<typename Dest>
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 );
else
{
@@ -402,7 +402,7 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
template<typename Dest>
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 );
else
scaleAndAddTo(dst,Scalar(1));
@@ -411,7 +411,7 @@ class GeneralProduct<Lhs, Rhs, GemmProduct>
template<typename Dest>
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 );
else
scaleAndAddTo(dst,Scalar(-1));