Eigen 3.4.90
doc
examples
Tutorial_ArrayClass_addition.cpp
Go to the documentation of this file.
1
#include <
Eigen/Dense
>
2
#include <iostream>
3
4
int
main
()
5
{
6
Eigen::ArrayXXf
a
(3,3);
7
Eigen::ArrayXXf
b
(3,3);
8
a
<< 1,2,3,
9
4,5,6,
10
7,8,9;
11
b
<< 1,2,3,
12
1,2,3,
13
1,2,3;
14
15
// Adding two arrays
16
std::cout <<
"a + b = "
<< std::endl <<
a
+
b
<< std::endl << std::endl;
17
18
// Subtracting a scalar from an array
19
std::cout <<
"a - 2 = "
<< std::endl <<
a
- 2 << std::endl;
20
}
a
ArrayXXi a
Definition:
Array_initializer_list_23_cxx11.cpp:1
b
Array< int, 3, 1 > b
Definition:
Array_variadic_ctor_cxx11.cpp:2
Dense
main
int main()
Definition:
Tutorial_ArrayClass_addition.cpp:4
Eigen::Array
General-purpose arrays with easy API for coefficient-wise operations.
Definition:
Array.h:49