gtsam
3rdparty
Eigen
doc
examples
Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp
Go to the documentation of this file.
1
#include <Eigen/Dense>
2
#include <iostream>
3
4
using namespace
std
;
5
using namespace
Eigen
;
6
7
int
main
()
8
{
9
VectorXf
v
(2);
10
MatrixXf
m
(2,2),
n
(2,2);
11
12
v
<< -1,
13
2;
14
15
m
<< 1,-2,
16
-3,4;
17
18
cout <<
"v.squaredNorm() = "
<<
v
.squaredNorm() << endl;
19
cout <<
"v.norm() = "
<<
v
.norm() << endl;
20
cout <<
"v.lpNorm<1>() = "
<<
v
.lpNorm<1>() << endl;
21
cout <<
"v.lpNorm<Infinity>() = "
<<
v
.lpNorm<
Infinity
>() << endl;
22
23
cout << endl;
24
cout <<
"m.squaredNorm() = "
<<
m
.squaredNorm() << endl;
25
cout <<
"m.norm() = "
<<
m
.norm() << endl;
26
cout <<
"m.lpNorm<1>() = "
<<
m
.lpNorm<1>() << endl;
27
cout <<
"m.lpNorm<Infinity>() = "
<<
m
.lpNorm<
Infinity
>() << endl;
28
}
Eigen
Namespace containing all symbols from the Eigen library.
Definition:
jet.h:637
n
int n
Definition:
BiCGSTAB_simple.cpp:1
main
int main()
Definition:
Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp:7
m
Matrix3f m
Definition:
AngleAxis_mimic_euler.cpp:1
std
Definition:
BFloat16.h:88
v
Array< int, Dynamic, 1 > v
Definition:
Array_initializer_list_vector_cxx11.cpp:1
Eigen::Infinity
const int Infinity
Definition:
Constants.h:36
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:18:19