|[eigen] Assignment of product to X.noalias() does not resize X|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
What is the reason behind the following inconsistency (using the current
revision of the development branch)?
using namespace Eigen;
MatrixXf A = MatrixXf::Random(12,12);
A2 = A * A; // works
std::cout << A2(1,1) << std::endl;
A3.noalias() = A * A; // works
std::cout << A3(1,1) << std::endl;
A4.noalias() = A * A; // does NOT work
std::cout << A4(1,1) << std::endl;
The assignment to A4 complains (via a run-time assertion) that A4 has the
wrong dimension. Yet when we leave out the noalias(), as in the assignment
to A2, it does resize the matrix to the correct dimension.
In the 2.0 branch, A4 = (A * A).lazy() does resize the matrix A4.