diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2016-08-12 15:15:34 +0200 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2016-08-12 15:15:34 +0200 |
commit | c83b754ee0c65881fe8e42b2b901e23fe6adbb1c (patch) | |
tree | 712b0674cf74aebf0b97555d8fb4aaf1d0fa67ee /Eigen/src/Core/CommaInitializer.h | |
parent | e3a8dfb02fff69dc455ba724b1f42a697ea4308c (diff) |
bug #1272: Disable assertion when total number of columns is zero.
Also moved assertion to finished() method and adapted unit-test
Diffstat (limited to 'Eigen/src/Core/CommaInitializer.h')
-rw-r--r-- | Eigen/src/Core/CommaInitializer.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Eigen/src/Core/CommaInitializer.h b/Eigen/src/Core/CommaInitializer.h index b39a661d0..d218e9814 100644 --- a/Eigen/src/Core/CommaInitializer.h +++ b/Eigen/src/Core/CommaInitializer.h @@ -103,9 +103,7 @@ struct CommaInitializer EIGEN_EXCEPTION_SPEC(Eigen::eigen_assert_exception) #endif { - eigen_assert((m_row+m_currentBlockRows) == m_xpr.rows() - && m_col == m_xpr.cols() - && "Too few coefficients passed to comma initializer (operator<<)"); + finished(); } /** \returns the built matrix once all its coefficients have been set. @@ -116,7 +114,12 @@ struct CommaInitializer * \endcode */ EIGEN_DEVICE_FUNC - inline XprType& finished() { return m_xpr; } + inline XprType& finished() { + eigen_assert(((m_row+m_currentBlockRows) == m_xpr.rows() || m_xpr.cols() == 0) + && m_col == m_xpr.cols() + && "Too few coefficients passed to comma initializer (operator<<)"); + return m_xpr; + } XprType& m_xpr; // target expression Index m_row; // current row id |