Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp File Reference

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 4 of file Tutorial_ReductionsVisitorsBroadcasting_reductions_norm.cpp.

5 {
7  Eigen::MatrixXf m(2,2), n(2,2);
8 
9  v << -1,
10  2;
11 
12  m << 1,-2,
13  -3,4;
14 
15  std::cout << "v.squaredNorm() = " << v.squaredNorm() << std::endl;
16  std::cout << "v.norm() = " << v.norm() << std::endl;
17  std::cout << "v.lpNorm<1>() = " << v.lpNorm<1>() << std::endl;
18  std::cout << "v.lpNorm<Infinity>() = " << v.lpNorm<Eigen::Infinity>() << std::endl;
19 
20  std::cout << std::endl;
21  std::cout << "m.squaredNorm() = " << m.squaredNorm() << std::endl;
22  std::cout << "m.norm() = " << m.norm() << std::endl;
23  std::cout << "m.lpNorm<1>() = " << m.lpNorm<1>() << std::endl;
24  std::cout << "m.lpNorm<Infinity>() = " << m.lpNorm<Eigen::Infinity>() << std::endl;
25 }
Matrix3f m
Array< int, Dynamic, 1 > v
int n
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
const int Infinity
Definition: Constants.h:38