Tutorial_ReductionsVisitorsBroadcasting_reductions_bool.cpp revision c981c48f5bc9aefeffc0bcb0cc3934c2fae179dd
1#include <Eigen/Dense> 2#include <iostream> 3 4using namespace std; 5using namespace Eigen; 6 7int main() 8{ 9 ArrayXXf a(2,2); 10 11 a << 1,2, 12 3,4; 13 14 cout << "(a > 0).all() = " << (a > 0).all() << endl; 15 cout << "(a > 0).any() = " << (a > 0).any() << endl; 16 cout << "(a > 0).count() = " << (a > 0).count() << endl; 17 cout << endl; 18 cout << "(a > 2).all() = " << (a > 2).all() << endl; 19 cout << "(a > 2).any() = " << (a > 2).any() << endl; 20 cout << "(a > 2).count() = " << (a > 2).count() << endl; 21} 22