Advertisement
Guest User

Eigen resized self-assignment bug

a guest
May 18th, 2013
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <Eigen/Dense>
  3. using namespace Eigen;
  4. using namespace std;
  5.  
  6. int main() {
  7.     MatrixXd x = MatrixXd::Zero(2,1);
  8.     x(0,0) = 1;
  9.     x = x.block(0,0,1,1);
  10.     cout << x(0,0) << endl;
  11. }
  12.  
  13. Desired output:
  14. 1
  15. Current output:
  16. 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement