From 56c7e164f026c2a07ca6d4d3d81fcce2fd0c570e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 24 Jan 2009 15:22:44 +0000 Subject: add partial count redux (adapted patch from Ricard Marxer) --- doc/snippets/PartialRedux_count.cpp | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/snippets/PartialRedux_count.cpp (limited to 'doc/snippets/PartialRedux_count.cpp') 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; -- cgit v1.2.3