Finish doc page on aliasing.

This commit is contained in:
Jitse Niesen
2010-12-27 15:06:55 +00:00
parent dc3618a557
commit 42a050dc68
4 changed files with 62 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
MatrixXf matA(2,2), matB(2,2);
matA << 2, 0, 0, 2;
// Simple but not quite as efficient
matB = matA * matA;
cout << matB << endl << endl;
// More complicated but also more efficient
matB.noalias() = matA * matA;
cout << matB;