Tutorial_ArrayClass_interop.cpp
Go to the documentation of this file.
1 #include <Eigen/Dense>
2 #include <iostream>
3 
4 using Eigen::MatrixXf;
5 
6 int main()
7 {
8  MatrixXf m(2,2);
9  MatrixXf n(2,2);
10  MatrixXf result(2,2);
11 
12  m << 1,2,
13  3,4;
14  n << 5,6,
15  7,8;
16 
17  result = (m.array() + 4).matrix() * m;
18  std::cout << "-- Combination 1: --\n" << result << "\n\n";
19  result = (m.array() * n.array()).matrix() * m;
20  std::cout << "-- Combination 2: --\n" << result << "\n\n";
21 }
Matrix3f m
int n
Matrix< float, Dynamic, Dynamic > MatrixXf
Dynamic×Dynamic matrix of type float.
Definition: Matrix.h:501