Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / libs / eigen / doc / examples / Tutorial_ArrayClass_interop.cpp
blob371f070680c0aa48a8270e4891edd99574a31260
1 #include <Eigen/Dense>
2 #include <iostream>
4 using namespace Eigen;
5 using namespace std;
7 int main()
9 MatrixXf m(2,2);
10 MatrixXf n(2,2);
11 MatrixXf result(2,2);
13 m << 1,2,
14 3,4;
15 n << 5,6,
16 7,8;
18 result = (m.array() + 4).matrix() * m;
19 cout << "-- Combination 1: --" << endl << result << endl << endl;
20 result = (m.array() * n.array()).matrix() * m;
21 cout << "-- Combination 2: --" << endl << result << endl << endl;