The norm module
This module contains implementations of various linear algebra norms.
The implementations are contained within the
MatrixNorm traits. This module also contains
MatrixMetric traits which are used to compute the metric distance.
These traits can be used directly by importing implementors from
this module. In most cases it will be easier to use the
metric functions which exist for both vectors and matrices. These
functions take generic arguments for the norm to be used.
In general you should use the least generic norm that fits your purpose.
For example you would choose to use a
Euclidean norm instead of an
Lp(2.0) norm - despite them being mathematically equivalent.
Note that these traits enforce no requirements on the norm. It is up to the user to ensure that they define a norm correctly.
To define your own norm you need to implement the
VectorNorm on your own struct. When you have defined
a norm you get the induced metric for free. This means that any
object which implements the
automatically implement the
respectively. This induced metric will compute the norm of the
difference between the vectors or matrices.
The Euclidean norm
The Lp norm
Trait for matrix metrics.
Trait for matrix norms.
Trait for vector metrics.
Trait for vector norms