From 3454b4e5f1eb1a68e15415eeca827a30cb3bb58e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 18 Apr 2014 17:06:03 +0200 Subject: [PATCH] Fix calls to lazy products (lazy product does not like matrices with 0 length) --- Eigen/src/Core/products/GeneralMatrixMatrix.h | 6 +++--- 1 file 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 template 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 template 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 template 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));