00001 MatrixXf matA(2,2), matB(2,2); 00002 matA << 2, 0, 0, 2; 00003 00004 // Simple but not quite as efficient 00005 matB = matA * matA; 00006 cout << matB << endl << endl; 00007 00008 // More complicated but also more efficient 00009 matB.noalias() = matA * matA; 00010 cout << matB;