diff options
author | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2013-08-06 09:49:44 +0100 |
---|---|---|
committer | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2013-08-06 09:49:44 +0100 |
commit | 616f9cc593fb47e39e0a47b6a749f15d66a5c734 (patch) | |
tree | 367421e08f670cf632fd5e2fce5e27651d992f10 /doc/snippets | |
parent | 2f0faf117ead5f92424bd3c67c434eb3ecaa9661 (diff) |
doc: Explain type of result for VectorwiseOp member functions.
Prompted by a question on the forum.
Diffstat (limited to 'doc/snippets')
-rw-r--r-- | doc/snippets/PartialRedux_count.cpp | 4 |
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; |