2023-12-06 05:22:55 +08:00
|
|
|
MatrixXi mat(3, 3);
|
|
|
|
|
mat << 1, 2, 3, 4, 5, 6, 7, 8, 9;
|
2010-08-01 04:37:29 +08:00
|
|
|
cout << "Here is the matrix mat:\n" << mat << endl;
|
2010-08-24 00:23:30 +08:00
|
|
|
|
|
|
|
|
// This assignment shows the aliasing problem
|
2023-12-06 05:22:55 +08:00
|
|
|
mat.bottomRightCorner(2, 2) = mat.topLeftCorner(2, 2);
|
2010-08-01 04:37:29 +08:00
|
|
|
cout << "After the assignment, mat = \n" << mat << endl;
|