diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-06-23 10:25:04 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-06-23 10:25:04 +0200 |
commit | a3f7edf7e7672094190e04a0b4417de1abfa3de5 (patch) | |
tree | 39c44282cf1089692d3828828ee97be9dce8c742 /Eigen/src/Core/CommaInitializer.h | |
parent | a29a2cb4ff4eb153d8e725f126f178371cc0468c (diff) |
Biug 1242: fix comma init with empty matrices.
Diffstat (limited to 'Eigen/src/Core/CommaInitializer.h')
-rw-r--r-- | Eigen/src/Core/CommaInitializer.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Eigen/src/Core/CommaInitializer.h b/Eigen/src/Core/CommaInitializer.h index 2abc6605c..38b1112ff 100644 --- a/Eigen/src/Core/CommaInitializer.h +++ b/Eigen/src/Core/CommaInitializer.h @@ -80,8 +80,11 @@ struct CommaInitializer EIGEN_DEVICE_FUNC CommaInitializer& operator,(const DenseBase<OtherDerived>& other) { - if(other.cols()==0 || other.rows()==0) + if(other.rows()==0) + { + m_col += other.cols(); return *this; + } if (m_col==m_xpr.cols()) { m_row+=m_currentBlockRows; @@ -90,7 +93,7 @@ struct CommaInitializer eigen_assert(m_row+m_currentBlockRows<=m_xpr.rows() && "Too many rows passed to comma initializer (operator<<)"); } - eigen_assert(m_col<m_xpr.cols() + eigen_assert(m_col<m_xpr.cols() || (m_xpr.cols()==0 && m_col==0) && "Too many coefficients passed to comma initializer (operator<<)"); eigen_assert(m_currentBlockRows==other.rows()); if (OtherDerived::SizeAtCompileTime != Dynamic) |