aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/snippets/PartialRedux_count.cpp
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2013-08-06 09:49:44 +0100
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2013-08-06 09:49:44 +0100
commit616f9cc593fb47e39e0a47b6a749f15d66a5c734 (patch)
tree367421e08f670cf632fd5e2fce5e27651d992f10 /doc/snippets/PartialRedux_count.cpp
parent2f0faf117ead5f92424bd3c67c434eb3ecaa9661 (diff)
doc: Explain type of result for VectorwiseOp member functions.
Prompted by a question on the forum.
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;