aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/PartialRedux_count.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-01-24 15:22:44 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-01-24 15:22:44 +0000
commit56c7e164f026c2a07ca6d4d3d81fcce2fd0c570e (patch)
treefc5612d89bda361eb5b2a1f126b14d2a937632ab /doc/snippets/PartialRedux_count.cpp
parent81b0ab53cfcbe9569c3bc67e1c42a9075997da4c (diff)
add partial count redux (adapted patch from Ricard Marxer)
Diffstat (limited to 'doc/snippets/PartialRedux_count.cpp')
-rw-r--r--doc/snippets/PartialRedux_count.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/snippets/PartialRedux_count.cpp b/doc/snippets/PartialRedux_count.cpp
new file mode 100644
index 000000000..914a5dee3
--- /dev/null
+++ b/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.cwise() >= 0.5).rowwise().count() << endl;