gtsam
3rdparty
Eigen
doc
examples
Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <Eigen/Dense>
3
4
using namespace
std
;
5
using namespace
Eigen
;
6
7
int
main
()
8
{
9
Eigen::MatrixXf
m
(2,2);
10
11
m
<< 1, 2,
12
3, 4;
13
14
//get location of maximum
15
MatrixXf::Index
maxRow, maxCol;
16
float
max
=
m
.maxCoeff(&maxRow, &maxCol);
17
18
//get location of minimum
19
MatrixXf::Index
minRow, minCol;
20
float
min
=
m
.minCoeff(&minRow, &minCol);
21
22
cout <<
"Max: "
<<
max
<<
", at: "
<<
23
maxRow <<
","
<< maxCol << endl;
24
cout <<
"Min: "
<<
min
<<
", at: "
<<
25
minRow <<
","
<< minCol << endl;
26
}
Eigen
Namespace containing all symbols from the Eigen library.
Definition:
jet.h:637
m
Matrix3f m
Definition:
AngleAxis_mimic_euler.cpp:1
std
Definition:
BFloat16.h:88
min
#define min(a, b)
Definition:
datatypes.h:19
main
int main()
Definition:
Tutorial_ReductionsVisitorsBroadcasting_visitors.cpp:7
max
#define max(a, b)
Definition:
datatypes.h:20
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition:
Meta.h:74
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:36