Support for matrix-norms (operator-norms)
Submitted by Fabio Rossetto
Assigned to Nobody
Link to original bugzilla bug (#1071)
Version: 3.3 (current stable)
Description
In the documentation page on norms (http://eigen.tuxfamily.org/dox/group__TutorialReductionsVisitorsBroadcasting.html#title1) is written that:
"The template parameter p can take the special value Infinity if you want the infinity norm, which is the maximum of the absolute values of the coefficients."
The way the norm is computed reflects the definition (see Core/Dot.h, line 193), but this definition holds true only for vectors.
The infinity norm of a matrix is not the max absolute values of the coefficients but rather the maximum absolute row sum of the matrix (see Wikipedia, https://en.wikipedia.org/wiki/Matrix_norm).
How to reproduce:
Eigen::MatrixXd eX = Eigen::MatrixXd(3,3);
eX <<
-3,5,7,
2,6,4,
0,2,8;
std::cout << eX.lpNormEigen::Infinity() << std::endl; // Should be 15, is 8 instead