Zero-sized matrices generate assertion failures
Submitted by Kerry Loux
Assigned to Nobody
Link to original bugzilla bug (#1669)
Version: 3.3 (current stable)
In previous versions (including v3.2) inverses of zero-sized matrices were supported. The following code, for example, would compile and execute without issue in v3.2:
Eigen::MatrixXd a;// NOTE: using Eigen::Matrix<double, 0, 0> fails with compile-time error on the last line below
Eigen::Matrix<double, 0, 1> b;
std::cout << a.inverse() * b << std::endl;
In v3.3, this code generates the following runtime error:
Assertion failed: this->rows()>0 && this->cols()>0 && "you are using an empty matrix", file c:\lib\eigen\eigen\src\core\redux.h, line 413
It appears that the file eigen/Eigen/src/Core/Redux.h has many assertions with this "you are using an empty matrix" explanation which are not there in v3.2.
Because this was supported in v3.2 and there are good reasons to continue to support such code, I believe this behavior is a bug.