Enum rulinalg::norm::Lp [] [src]

pub enum Lp<T: Float> {
    Infinity,
    Integer(i32),
    Float(T),
}

The Lp norm

The Lp norm computes the pth root of the sum of elements to the pth 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

The L-infinity norm (supremum)

The Lp norm where p is an integer

The Lp norm where p is a float

Trait Implementations

impl<T: Debug + Float> Debug for Lp<T>
[src]

Formats the value using the given formatter.

impl<T: Float> VectorNorm<T> for Lp<T>
[src]

Computes the vector norm.

impl<T: Float, M: BaseMatrix<T>> MatrixNorm<T, M> for Lp<T>
[src]

Computes the matrix norm.