Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <Eigen/Dense>
00003 
00004 using namespace std;
00005 using namespace Eigen;
00006 
00007 int main()
00008 {
00009   Eigen::MatrixXf m(2,2);
00010   
00011   m << 1, 2,
00012        3, 4;
00013 
00014   //get location of maximum
00015   MatrixXf::Index maxRow, maxCol;
00016   float max = m.maxCoeff(&maxRow, &maxCol);
00017 
00018   //get location of minimum
00019   MatrixXf::Index minRow, minCol;
00020   float min = m.minCoeff(&minRow, &minCol);
00021 
00022   cout << "Max: " << max <<  ", at: " <<
00023      maxRow << "," << maxCol << endl;
00024   cout << "Min: " << min << ", at: " <<
00025      minRow << "," << minCol << endl;
00026 }


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:33:27