Eigen 3.4.90
Main Page
Related Pages
Modules
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Typedefs
_
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
Enumerator
a
b
c
d
e
f
h
i
k
m
n
o
p
q
r
s
t
u
v
Related Functions
o
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
a
b
c
d
e
g
h
i
j
l
m
n
o
p
q
r
s
t
v
w
x
y
Typedefs
a
b
c
d
e
f
i
l
m
n
r
s
t
u
Macros
_
a
b
c
d
e
f
g
h
l
m
p
s
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
doc
examples
tut_arithmetic_add_sub.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <
Eigen/Dense
>
3
4
int
main
()
5
{
6
Eigen::Matrix2d
a
;
7
a
<< 1, 2,
8
3, 4;
9
Eigen::MatrixXd
b
(2,2);
10
b
<< 2, 3,
11
1, 4;
12
std::cout <<
"a + b =\n"
<<
a
+
b
<< std::endl;
13
std::cout <<
"a - b =\n"
<<
a
-
b
<< std::endl;
14
std::cout <<
"Doing a += b;"
<< std::endl;
15
a
+=
b
;
16
std::cout <<
"Now a =\n"
<<
a
<< std::endl;
17
Eigen::Vector3d
v
(1,2,3);
18
Eigen::Vector3d
w
(1,0,0);
19
std::cout <<
"-v + w - v =\n"
<< -
v
+
w
-
v
<< std::endl;
20
}
a
ArrayXXi a
Definition:
Array_initializer_list_23_cxx11.cpp:1
v
Array< int, Dynamic, 1 > v
Definition:
Array_initializer_list_vector_cxx11.cpp:1
b
Array< int, 3, 1 > b
Definition:
Array_variadic_ctor_cxx11.cpp:2
Dense
w
RowVector3d w
Definition:
Matrix_resize_int.cpp:3
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition:
Matrix.h:182
main
int main()
Definition:
tut_arithmetic_add_sub.cpp:4
Code