Line | |
---|
1 | #include <Eigen/Dense>
|
---|
2 | #include <iostream>
|
---|
3 |
|
---|
4 | using namespace Eigen;
|
---|
5 | using namespace std;
|
---|
6 |
|
---|
7 | int main(int, char**)
|
---|
8 | {
|
---|
9 | cout.precision(3);
|
---|
10 | Matrix3f m = Matrix3f::Random();
|
---|
11 | std::ptrdiff_t i, j;
|
---|
12 | float minOfM = m.minCoeff(&i,&j);
|
---|
13 | cout << "Here is the matrix m:\n" << m << endl;
|
---|
14 | cout << "Its minimum coefficient (" << minOfM
|
---|
15 | << ") is at position (" << i << "," << j << ")\n\n";
|
---|
16 |
|
---|
17 | RowVector4i v = RowVector4i::Random();
|
---|
18 | int maxOfV = v.maxCoeff(&i);
|
---|
19 | cout << "Here is the vector v: " << v << endl;
|
---|
20 | cout << "Its maximum coefficient (" << maxOfV
|
---|
21 | << ") is at position " << i << endl;
|
---|
22 |
|
---|
23 | return 0;
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.