diff options
Diffstat (limited to 'eigen/doc/snippets/PartialRedux_count.cpp')
-rw-r--r-- | eigen/doc/snippets/PartialRedux_count.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/eigen/doc/snippets/PartialRedux_count.cpp b/eigen/doc/snippets/PartialRedux_count.cpp index c7b3097..1c3b3a2 100644 --- a/eigen/doc/snippets/PartialRedux_count.cpp +++ b/eigen/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; |