gtsam
3rdparty
Eigen
doc
examples
tut_arithmetic_add_sub.cpp
Go to the documentation of this file.
1
#include <iostream>
2
#include <Eigen/Dense>
3
4
using namespace
Eigen
;
5
6
int
main
()
7
{
8
Matrix2d
a
;
9
a
<< 1, 2,
10
3, 4;
11
MatrixXd
b
(2,2);
12
b
<< 2, 3,
13
1, 4;
14
std::cout <<
"a + b =\n"
<<
a
+
b
<< std::endl;
15
std::cout <<
"a - b =\n"
<<
a
-
b
<< std::endl;
16
std::cout <<
"Doing a += b;"
<< std::endl;
17
a
+=
b
;
18
std::cout <<
"Now a =\n"
<<
a
<< std::endl;
19
Vector3d
v
(1,2,3);
20
Vector3d
w
(1,0,0);
21
std::cout <<
"-v + w - v =\n"
<< -
v
+
w
-
v
<< std::endl;
22
}
w
RowVector3d w
Definition:
Matrix_resize_int.cpp:3
Eigen
Namespace containing all symbols from the Eigen library.
Definition:
jet.h:637
b
Scalar * b
Definition:
benchVecAdd.cpp:17
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
main
int main()
Definition:
tut_arithmetic_add_sub.cpp:6
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:36