TopicAliasing_mult2.cpp revision c981c48f5bc9aefeffc0bcb0cc3934c2fae179dd
1MatrixXf matA(2,2), matB(2,2);
2matA << 2, 0,  0, 2;
3
4// Simple but not quite as efficient
5matB = matA * matA;
6cout << matB << endl << endl;
7
8// More complicated but also more efficient
9matB.noalias() = matA * matA;
10cout << matB;
11