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 }
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
main
int main()
Definition: Tutorial_ReductionsVisitorsBroadcasting_reductions_operatornorm.cpp:7
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
std
Definition: BFloat16.h:88


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:36