This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1242 - Comma initializer error for matrix with 0 rows
Summary: Comma initializer error for matrix with 0 rows
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: x86 - 64-bit Linux
: Normal Crash
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-22 08:39 UTC by Mikhail Katliar
Modified: 2019-12-04 15:55 UTC (History)
3 users (show)



Attachments

Description Mikhail Katliar 2016-06-22 08:39:48 UTC
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.
```
Comment 1 Gael Guennebaud 2016-06-23 08:27:19 UTC
ouch, that's a truly nasty corner case!

Fixed:
default: https://bitbucket.org/eigen/eigen/commits/30293148a638/
3.2:     https://bitbucket.org/eigen/eigen/commits/44abf0a7b16a/
Comment 2 Nobody 2019-12-04 15:55:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1242.

Note You need to log in before you can comment on or make changes to this bug.