mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clang-format tests, examples, libraries, benchmarks, etc.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
3252ecc7a4
commit
46e9cdb7fe
@@ -1,23 +1,19 @@
|
||||
#include <iostream>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
int main()
|
||||
{
|
||||
Eigen::MatrixXf m(2,2);
|
||||
|
||||
m << 1, 2,
|
||||
3, 4;
|
||||
int main() {
|
||||
Eigen::MatrixXf m(2, 2);
|
||||
|
||||
//get location of maximum
|
||||
m << 1, 2, 3, 4;
|
||||
|
||||
// get location of maximum
|
||||
Eigen::Index maxRow, maxCol;
|
||||
float max = m.maxCoeff(&maxRow, &maxCol);
|
||||
|
||||
//get location of minimum
|
||||
// get location of minimum
|
||||
Eigen::Index minRow, minCol;
|
||||
float min = m.minCoeff(&minRow, &minCol);
|
||||
|
||||
std::cout << "Max: " << max << ", at: " <<
|
||||
maxRow << "," << maxCol << std::endl;
|
||||
std:: cout << "Min: " << min << ", at: " <<
|
||||
minRow << "," << minCol << std::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