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 }
Matrix3f m
int n
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Definition: BFloat16.h:88
Array< int, Dynamic, 1 > v
const int Infinity
Definition: Constants.h:36


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:40:38