Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.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_operatornorm.cpp.

5 {
6  Eigen::MatrixXf m(2,2);
7  m << 1,-2,
8  -3,4;
9 
10  std::cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff()
11  << " == " << m.colwise().lpNorm<1>().maxCoeff() << std::endl;
12 
13  std::cout << "infty-norm(m) = " << m.cwiseAbs().rowwise().sum().maxCoeff()
14  << " == " << m.rowwise().lpNorm<1>().maxCoeff() << std::endl;
15 }
Matrix3f m
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182