Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp
Go to the documentation of this file.
1 #include <Eigen/Dense>
2 #include <iostream>
3 
4 int main()
5 {
6  Eigen::ArrayXXf a(2,2);
7 
8  a << 1,2,
9  3,4;
10 
11  std::cout << "(a > 0).all() = " << (a > 0).all() << std::endl;
12  std::cout << "(a > 0).any() = " << (a > 0).any() << std::endl;
13  std::cout << "(a > 0).count() = " << (a > 0).count() << std::endl;
14  std::cout << std::endl;
15  std::cout << "(a > 2).all() = " << (a > 2).all() << std::endl;
16  std::cout << "(a > 2).any() = " << (a > 2).any() << std::endl;
17  std::cout << "(a > 2).count() = " << (a > 2).count() << std::endl;
18 }
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:49
static const Eigen::internal::all_t all