aboutsummaryrefslogtreecommitdiff
path: root/doc/snippets/PartialRedux_count.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/snippets/PartialRedux_count.cpp')
-rw-r--r--doc/snippets/PartialRedux_count.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/snippets/PartialRedux_count.cpp b/doc/snippets/PartialRedux_count.cpp
index c7b3097e4..1c3b3a28f 100644
--- a/doc/snippets/PartialRedux_count.cpp
+++ b/doc/snippets/PartialRedux_count.cpp
@@ -1,3 +1,5 @@
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;
+Matrix<ptrdiff_t, 3, 1> res = (m.array() >= 0.5).rowwise().count();
+cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl;
+cout << res << endl;