blob: 3769573597e94bce25e8f40bc458394aac5df086 [file] [log] [blame]
Benoit Jacobe7bdbe2e2007-12-27 21:43:10 +00001Matrix2f M = Matrix2f::random();
2Matrix2f m;
3m = M;
4cout << "Here is the matrix m:" << endl << m << endl;
5cout << "Now we want to replace m by its own transpose." << endl;
6cout << "If we do m = m.transpose(), then m becomes:" << endl;
7m = m.transpose();
8cout << m << endl << "which is wrong!" << endl;
9cout << "Now let us instead do m = m.transpose().eval(). Then m becomes" << endl;
10m = M;
11m = m.transpose().eval();
12cout << m << endl << "which is right." << endl;