Summary: | Matrix-vector product works in 3.1; breaks in 3.2.4. | ||
---|---|---|---|
Product: | Eigen | Reporter: | Hoyt <hoytak> |
Component: | Core - matrix products | Assignee: | Nobody <eigen.nobody> |
Status: | RESOLVED FIXED | ||
Severity: | Compilation Problem | CC: | chtz, gael.guennebaud |
Priority: | Normal | ||
Version: | 3.2 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: |
Description
Hoyt
2015-02-25 19:16:15 UTC
Can you please provide a minimal example? The following compiled fine for me, for both 3.2.4 and 3.2-head: #include <Eigen/Core> EIGEN_DONT_INLINE void test(Eigen::VectorXf& w, const Eigen::MatrixXf& A, int i, int j, int n) { w.noalias() = A.middleRows(i, n) * A.row(j).transpose(); } From your error message it looks as if the type of A is actually: Eigen::Matrix<float, -1, 0, 1, -1, 0> which does not really make sense (Cols=0 but MaxColsAtCompileTime=Dynamic should IMO give a static assertion) but still does compile at my machine. I only tested g++ 4.7 and 4.8, however. Are you sure your Eigen version has not been modified somehow? Or perhaps you have some #define which corrupts Eigen's behavior. Yes, I apologize -- this was inside of a templated function, so it was not MatrixXf as noted. The following code gives me the error above. The use case is that we use a fixed column size of 0 to essentially disable some parts of our algorithm. static void test_f() { // Compiles fine in 3.1.4, fails compilation in 3.2.4 Eigen::Matrix<float, Eigen::Dynamic, 0, Eigen::RowMajor> V; Eigen::Matrix<float, -1, 1> w; V.resize(1000, 0); w.noalias() = V.middleRows(0,500) * V.row(501).transpose(); } Confirmed and fixed: https://bitbucket.org/eigen/eigen/commits/a8957c419535/ Changeset: a8957c419535 Branch: 3.2 User: ggael Date: 2015-02-28 14:25:39+00:00 Summary: Fix bug 972: allow coeff-based products of depth 0 and remove a useless statement in coeff-based product. This was already fixed in the devel branch. -- 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/972. |