eigen/doc/snippets/tut_arithmetic_transpose_aliasing.cpp

7 lines
189 B
C++
Raw Normal View History

Matrix2i a;
a << 1, 2, 3, 4;
2010-06-28 06:05:11 +08:00
cout << "Here is the matrix a:\n" << a << endl;
a = a.transpose(); // !!! do NOT do this !!!
cout << "and the result of the aliasing effect:\n" << a << endl;