xref: /aosp_15_r20/external/eigen/doc/snippets/TopicAliasing_block.cpp (revision bf2c37156dfe67e5dfebd6d394bad8b2ab5804d4)
1*bf2c3715SXin Li MatrixXi mat(3,3);
2*bf2c3715SXin Li mat << 1, 2, 3,   4, 5, 6,   7, 8, 9;
3*bf2c3715SXin Li cout << "Here is the matrix mat:\n" << mat << endl;
4*bf2c3715SXin Li 
5*bf2c3715SXin Li // This assignment shows the aliasing problem
6*bf2c3715SXin Li mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2);
7*bf2c3715SXin Li cout << "After the assignment, mat = \n" << mat << endl;
8