Expand description
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
sourceimpl<T: Float, M: BaseMatrix<T>> MatrixNorm<T, M> for Lp<T>
impl<T: Float, M: BaseMatrix<T>> MatrixNorm<T, M> for Lp<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Lp<T>where
T: RefUnwindSafe,
impl<T> Send for Lp<T>where
T: Send,
impl<T> Sync for Lp<T>where
T: Sync,
impl<T> Unpin for Lp<T>where
T: Unpin,
impl<T> UnwindSafe for Lp<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more