Jitse Niesen | 2b5a006 | 2010-07-23 20:32:33 +0100 | [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.cwiseEqual(MatrixXi::Identity(2,2)) << endl; | ||||
Christoph Hertzberg | 5e79402 | 2018-07-24 21:59:15 +0200 | [diff] [blame] | 6 | Index count = m.cwiseEqual(MatrixXi::Identity(2,2)).count(); |
Jitse Niesen | 2b5a006 | 2010-07-23 20:32:33 +0100 | [diff] [blame] | 7 | cout << "Number of coefficients that are equal: " << count << endl; |