xref: /aosp_15_r20/external/eigen/doc/examples/Tutorial_ReductionsVisitorsBroadcasting_colwise.cpp (revision bf2c37156dfe67e5dfebd6d394bad8b2ab5804d4)
1 #include <iostream>
2 #include <Eigen/Dense>
3 
4 using namespace std;
main()5 int main()
6 {
7   Eigen::MatrixXf mat(2,4);
8   mat << 1, 2, 6, 9,
9          3, 1, 7, 2;
10 
11   std::cout << "Column's maximum: " << std::endl
12    << mat.colwise().maxCoeff() << std::endl;
13 }
14