Simultaneous row/column-vector and Matrix/Array conversion
Submitted by nev..@..il.com
Assigned to Nobody
Link to original bugzilla bug (#654)
Version: 3.2
Description
Created attachment 378
failure case
This is at the very least not expected behavior - when using a mixed compile time and dynamic matrix (ie a list of 2d points) I get an assertion failure:
c++ -O0 -ggdb -DDEBUG -I/usr/include/eigen3 eigenfail.cpp -o /tmp/blah
./blah
blah: /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:238: void Eigen::PlainObjectBase<Eigen::Matrix<float, -1, 1, 0, -1, 1> >::resize(Index, Index) [Derived = Eigen::Matrix<float, -1, 1, 0, -1, 1>]: Assertion `(!(RowsAtCompileTime!=Dynamic) || (nbRows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (nbCols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || (nbRows<=MaxRowsAtCompileTime)) && (!(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic) || (nbCols<=MaxColsAtCompileTime)) && nbRows>=0 && nbCols>=0 && "Invalid sizes when resizing a matrix or array."' failed.
Example program attached.
Interestingly, explicitly calling .matrix at the end of the expression has no error detected. This wasn't an issue in eigen 3.1.3 as far as I can tell.
Attachment 378, "failure case":
eigenfail.cpp