pub trait OperatorNorm: VectorSpace {
fn norm_l1(self) -> Self::Scalar;
fn norm_l2(self) -> Self::Scalar;
fn norm_linf(self) -> Self::Scalar;
}
Expand description
operator norms: $L^1$, $L^2$, and $L^\infty$.
Examples
use cgmath::*;
use matext4cgmath::*;
let mat = Matrix2::new(1.0, 3.0, -2.0, 4.0);
// L^1 operator norm is the maximum column absolute sumation.
assert_eq!(mat.norm_l1(), 6.0);
// L^2 operator norm is the maximum singular value.
let ans_norm_l2 = (5.0 + f64::sqrt(5.0)) / f64::sqrt(2.0);
assert!(f64::abs(mat.norm_l2() - ans_norm_l2) < 1.0e-10);
// L^∞ operator norm is the maximum row absolute sumation.
assert_eq!(mat.norm_linf(), 7.0);