Add examples for API documentation of MatrixBase::cwiseXxx() methods.

This commit is contained in:
Jitse Niesen
2010-07-23 20:32:33 +01:00
parent 072ee3c07d
commit 2b5a0060b4
10 changed files with 38 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
MatrixXi m(2,2);
m << 1, 0,
1, 1;
cout << "Comparing m with identity matrix:" << endl;
cout << m.cwiseNotEqual(MatrixXi::Identity(2,2)) << endl;
int count = m.cwiseNotEqual(MatrixXi::Identity(2,2)).count();
cout << "Number of coefficients that are not equal: " << count << endl;