![]() Registered Member ![]()
|
Hi,
This seems to be nonsense but somethimes I need the following operations: ----------------------------------------------------------- Eigen::Matrix<double, 6, 2> B; Eigen::Matrix<double, 2, 1> b; B.setConstant(1); b.setZero(); Eigen::Matrix<double, 6, 1> c = B.rightCols<0>() * b.head<0>(); std::cout << c; ----------------------------------------------------------------- Logically thinking, multiplication of 6-by-0 matrix to 0-by-1 vector is feasible and it gives 6-by-1 zero vector. However, Eigen doesn't allow this operation. It signals the assert "Assertion failed: lhs.cols()>0 && "you are using a non initialized matrix", file d:\.......\eigen\Eigen\src\core\products\coeffvaseproduct.h, line 265". Is there any way to make this operation feasible? Thanks in advance. |
![]() Moderator ![]()
|
This is currently not possible because for small matrices the reduction is implemented like this:
res = lhs.coeff(row, 0) * rhs.coeff(0, col); for(Index i = 1; i < lhs.cols(); ++i) res += lhs.coeff(row, i) * rhs.coeff(i, col); Feel free to add a bug entry so that we don't forget about it: http://eigen.tuxfamily.org/bz/ |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]