summaryrefslogtreecommitdiffhomepage
path: root/eigen/doc/snippets/PartialRedux_count.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'eigen/doc/snippets/PartialRedux_count.cpp')
-rw-r--r--eigen/doc/snippets/PartialRedux_count.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/eigen/doc/snippets/PartialRedux_count.cpp b/eigen/doc/snippets/PartialRedux_count.cpp
new file mode 100644
index 0000000..c7b3097
--- /dev/null
+++ b/eigen/doc/snippets/PartialRedux_count.cpp
@@ -0,0 +1,3 @@
+Matrix3d m = Matrix3d::Random();
+cout << "Here is the matrix m:" << endl << m << endl;
+cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl << (m.array() >= 0.5).rowwise().count() << endl;