You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
267 B

  1. MatrixXi mat(3,3);
  2. mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
  3. cout << "Here is the matrix mat:\n" << mat << endl;
  4. // This assignment shows the aliasing problem
  5. mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2);
  6. cout << "After the assignment, mat = \n" << mat << endl;