Brian Silverman | 72890c2 | 2015-09-19 14:37:37 -0400 | [diff] [blame] | 1 | MatrixXi m(2,2); |
2 | m << 1, 0, | ||||
3 | 1, 1; | ||||
4 | cout << "Comparing m with identity matrix:" << endl; | ||||
5 | cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl; | ||||
Austin Schuh | 189376f | 2018-12-20 22:11:15 +1100 | [diff] [blame^] | 6 | Index count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count(); |
Brian Silverman | 72890c2 | 2015-09-19 14:37:37 -0400 | [diff] [blame] | 7 | cout << "Number of coefficients that are not equal: " << count << endl; |