Comma initializer error for matrix with 0 rows
Submitted by Mikhail Katliar
Assigned to Nobody
Link to original bugzilla bug (#1242)
Version: 3.2
Operating system: Linux
Description
Example:
#include <Eigen/Dense>
void test()
{
auto const M = 0; // If changed to M = 1, works fine
auto const N1 = 2;
auto const N2 = 1;
Eigen::Matrix<double, M, N1> A1;
Eigen::Matrix<double, M, N2> A2;
Eigen::Matrix<double, M, N1 + N2> B;
B << A1, A2;
}
Produces the following error at runtime:
/usr/local/include/eigen3/Eigen/src/Core/CommaInitializer.h:114: Eigen::CommaInitializer<MatrixType>::~CommaInitializer() [with XprType = Eigen::Matrix<double, 0, 3>]: Assertion `(m_row+m_currentBlockRows) == m_xpr.rows() && m_col == m_xpr.cols() && "Too few coefficients passed to comma initializer (operator<<)"' failed.
Edited by Eigen Bugzilla