00001 MatrixXi m(2,2); 00002 m << 1, 0, 00003 1, 1; 00004 cout << "Comparing m with identity matrix:" << endl; 00005 cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl; 00006 int count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count(); 00007 cout << "Number of coefficients that are not equal: " << count << endl;