Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp
Go to the documentation of this file.
1 #include <Eigen/Dense>
2 #include <iostream>
3 
4 using namespace Eigen;
5 using namespace std;
6 
7 int main()
8 {
9  MatrixXf m(2,2);
10  m << 1,-2,
11  -3,4;
12 
13  cout << "1-norm(m) = " << m.cwiseAbs().colwise().sum().maxCoeff()
14  << " == " << m.colwise().lpNorm<1>().maxCoeff() << endl;
15 
16  cout << "infty-norm(m) = " << m.cwiseAbs().rowwise().sum().maxCoeff()
17  << " == " << m.rowwise().lpNorm<1>().maxCoeff() << endl;
18 }
Matrix3f m
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Definition: Half.h:150


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:51:19