OperatorNorm

Trait OperatorNorm 

Source
pub trait OperatorNorm: VectorSpace {
    // Required methods
    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);

Required Methods§

Source

fn norm_l1(self) -> Self::Scalar

operator norm for absolute value sumation: $L^1$.

Source

fn norm_l2(self) -> Self::Scalar

operator norm for Euclidean norm: $L^2$.

Source

fn norm_linf(self) -> Self::Scalar

operator norm for absolute value maximum: $L^{\infty}$.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<F: BaseFloat> OperatorNorm for Matrix2<F>

Source§

fn norm_l1(self) -> F

Source§

fn norm_linf(self) -> F

Source§

fn norm_l2(self) -> F

Source§

impl<F: BaseFloat> OperatorNorm for Matrix3<F>

Source§

fn norm_l1(self) -> F

Source§

fn norm_linf(self) -> F

Source§

fn norm_l2(self) -> F

Source§

impl<F: BaseFloat> OperatorNorm for Matrix4<F>

Source§

fn norm_l1(self) -> F

Source§

fn norm_linf(self) -> F

Source§

fn norm_l2(self) -> F

Implementors§