Enum rulinalg::norm::Lp
[−]
[src]
pub enum Lp<T: Float> { Infinity, Integer(i32), Float(T), }
The Lp norm
The
Lp norm
computes the p
th root of the sum of elements
to the p
th power.
The Lp norm requires p
to be greater than
or equal 1
.
We use an enum for this norm to allow us to explicitly handle
special cases at compile time. For example, we have an Infinity
variant which handles the special case when the Lp
norm is a
supremum over absolute values. The Integer
variant gives us a
performance boost when p
is an integer.
You should avoid matching directly against this enum as it is likely to grow.
Variants
Infinity
The L-infinity norm (supremum)
Integer(i32)
The Lp norm where p is an integer
Float(T)
The Lp norm where p is a float
Trait Implementations
impl<T: Debug + Float> Debug for Lp<T>
[src]
impl<T: Float> VectorNorm<T> for Lp<T>
[src]
impl<T: Float, M: BaseMatrix<T>> MatrixNorm<T, M> for Lp<T>
[src]
fn norm(&self, m: &M) -> T
Computes the matrix norm.