aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-07-23 19:20:10 +0100
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-07-23 19:20:10 +0100
commitae8425c74c92fb3e5f07629aa216b405fccfdbb3 (patch)
tree25e226864d549574041af8ca5d00760f2d313681 /doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
parent145830e06763e14a1aee21737e51504453c7f6a0 (diff)
Tutorial page 7: more typical example for .all(), minor copy-editing.
Diffstat (limited to 'doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp')
-rw-r--r--doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
index 10916877f..0cca37f36 100644
--- a/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
+++ b/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
@@ -6,19 +6,16 @@ using namespace Eigen;
int main()
{
- MatrixXf m(2,2), n(2,2);
+ ArrayXXf a(2,2);
- m << 0,2,
+ a << 1,2,
3,4;
- n << 1,2,
- 3,4;
-
- cout << "m.all() = " << m.all() << endl;
- cout << "m.any() = " << m.any() << endl;
- cout << "m.count() = " << m.count() << endl;
+ cout << "(a > 0).all() = " << (a > 0).all() << endl;
+ cout << "(a > 0).any() = " << (a > 0).any() << endl;
+ cout << "(a > 0).count() = " << (a > 0).count() << endl;
cout << endl;
- cout << "n.all() = " << n.all() << endl;
- cout << "n.any() = " << n.any() << endl;
- cout << "n.count() = " << n.count() << endl;
+ cout << "(a > 2).all() = " << (a > 2).all() << endl;
+ cout << "(a > 2).any() = " << (a > 2).any() << endl;
+ cout << "(a > 2).count() = " << (a > 2).count() << endl;
}