mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
get rid of using namespace Eigen in sample code
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
e4c40b092a
commit
39a6aff16c
@@ -1,9 +1,6 @@
|
||||
#include <iostream>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
using namespace std;
|
||||
using namespace Eigen;
|
||||
|
||||
int main()
|
||||
{
|
||||
Eigen::MatrixXf m(2,2);
|
||||
@@ -12,15 +9,15 @@ int main()
|
||||
3, 4;
|
||||
|
||||
//get location of maximum
|
||||
MatrixXf::Index maxRow, maxCol;
|
||||
Eigen::Index maxRow, maxCol;
|
||||
float max = m.maxCoeff(&maxRow, &maxCol);
|
||||
|
||||
//get location of minimum
|
||||
MatrixXf::Index minRow, minCol;
|
||||
Eigen::Index minRow, minCol;
|
||||
float min = m.minCoeff(&minRow, &minCol);
|
||||
|
||||
cout << "Max: " << max << ", at: " <<
|
||||
maxRow << "," << maxCol << endl;
|
||||
cout << "Min: " << min << ", at: " <<
|
||||
minRow << "," << minCol << endl;
|
||||
std::cout << "Max: " << max << ", at: " <<
|
||||
maxRow << "," << maxCol << std::endl;
|
||||
std:: cout << "Min: " << min << ", at: " <<
|
||||
minRow << "," << minCol << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user