2008-07-21 08:34:46 +08:00
|
|
|
Matrix2f M = Matrix2f::Random();
|
2007-12-28 05:43:10 +08:00
|
|
|
Matrix2f m;
|
|
|
|
m = M;
|
|
|
|
cout << "Here is the matrix m:" << endl << m << endl;
|
|
|
|
cout << "Now we want to replace m by its own transpose." << endl;
|
|
|
|
cout << "If we do m = m.transpose(), then m becomes:" << endl;
|
2009-08-16 16:55:10 +08:00
|
|
|
m = m.transpose() * 1;
|
2007-12-28 05:43:10 +08:00
|
|
|
cout << m << endl << "which is wrong!" << endl;
|
|
|
|
cout << "Now let us instead do m = m.transpose().eval(). Then m becomes" << endl;
|
|
|
|
m = M;
|
|
|
|
m = m.transpose().eval();
|
|
|
|
cout << m << endl << "which is right." << endl;
|